implement uuid and make sample data factory
This commit is contained in:
parent
656056a3b3
commit
6894c2c3c5
@ -22,7 +22,7 @@ public function create(){
|
|||||||
|
|
||||||
public function store(Request $request){
|
public function store(Request $request){
|
||||||
$formFields = $request->validate([
|
$formFields = $request->validate([
|
||||||
'device_id' => ['required', Rule::unique('devices', 'device_id')],
|
//'device_id' => ['required', Rule::unique('devices', 'device_id')],
|
||||||
'title' => 'required',
|
'title' => 'required',
|
||||||
'device_type' => 'required',
|
'device_type' => 'required',
|
||||||
'description' => 'required',
|
'description' => 'required',
|
||||||
@ -43,7 +43,7 @@ public function edit(Device $device) {
|
|||||||
|
|
||||||
public function update(Device $device, Request $request){
|
public function update(Device $device, Request $request){
|
||||||
$formFields = $request->validate([
|
$formFields = $request->validate([
|
||||||
'device_id' => 'required',
|
//'device_id' => 'required',
|
||||||
'title' => 'required',
|
'title' => 'required',
|
||||||
'device_type' => 'required',
|
'device_type' => 'required',
|
||||||
'description' => 'required',
|
'description' => 'required',
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
use App\Models\OwnerTransaction;
|
use App\Models\OwnerTransaction;
|
||||||
use App\Models\LocationTransaction;
|
use App\Models\LocationTransaction;
|
||||||
use App\Models\PurchasingInformation;
|
use App\Models\PurchasingInformation;
|
||||||
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
@ -12,7 +13,7 @@
|
|||||||
|
|
||||||
class Device extends Model
|
class Device extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasUuids;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table associated with the model.
|
* The table associated with the model.
|
||||||
@ -31,7 +32,7 @@ class Device extends Model
|
|||||||
*
|
*
|
||||||
* @var array<int, string>
|
* @var array<int, string>
|
||||||
*/
|
*/
|
||||||
protected $fillable = ['device_id', 'title', 'device_type', 'description', 'accessories', 'rz_username_buyer', 'serial_number', 'image_url'];
|
protected $fillable = [/* 'device_id', */'title', 'device_type', 'description', 'accessories', 'rz_username_buyer', 'serial_number', 'image_url'];
|
||||||
|
|
||||||
//The data type of the auto-incrementing ID.
|
//The data type of the auto-incrementing ID.
|
||||||
protected $keyType = 'string';
|
protected $keyType = 'string';
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Models\Device;
|
use App\Models\Device;
|
||||||
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class LocationTransaction extends Model
|
class LocationTransaction extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasUuids;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table associated with the model.
|
* The table associated with the model.
|
||||||
|
@ -3,13 +3,14 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Models\Device;
|
use App\Models\Device;
|
||||||
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class OwnerTransaction extends Model
|
class OwnerTransaction extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasUuids;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table associated with the model.
|
* The table associated with the model.
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class PurchasingInformation extends Model
|
class PurchasingInformation extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory, HasUuids;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The table associated with the model.
|
* The table associated with the model.
|
||||||
|
26
device-app/app/View/Components/DeviceDetail.php
Normal file
26
device-app/app/View/Components/DeviceDetail.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
|
class DeviceDetail extends Component
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new component instance.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the view / contents that represent the component.
|
||||||
|
*/
|
||||||
|
public function render(): View|Closure|string
|
||||||
|
{
|
||||||
|
return view('components.device-detail');
|
||||||
|
}
|
||||||
|
}
|
26
device-app/app/View/Components/DeviceSimple.php
Normal file
26
device-app/app/View/Components/DeviceSimple.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\View\Components;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
|
class DeviceSimple extends Component
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new component instance.
|
||||||
|
*/
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the view / contents that represent the component.
|
||||||
|
*/
|
||||||
|
public function render(): View|Closure|string
|
||||||
|
{
|
||||||
|
return view('components.device-simple');
|
||||||
|
}
|
||||||
|
}
|
@ -17,7 +17,7 @@ class DeviceFactory extends Factory
|
|||||||
public function definition(): array
|
public function definition(): array
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'device_id' => $this->faker->randomDigitNotNull(),
|
'device_id' => $this->faker->uuid(),
|
||||||
'title' => $this->faker->word(),
|
'title' => $this->faker->word(),
|
||||||
'device_type' => $this->faker->domainWord(),
|
'device_type' => $this->faker->domainWord(),
|
||||||
'description' => $this->faker->sentence(),
|
'description' => $this->faker->sentence(),
|
||||||
|
24
device-app/database/factories/LocationTransactionFactory.php
Normal file
24
device-app/database/factories/LocationTransactionFactory.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\LocationTransaction>
|
||||||
|
*/
|
||||||
|
class LocationTransactionFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'room_code' => $this->faker->buildingNumber(),
|
||||||
|
'timestamp_located_since' => $this->faker->unixTime()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
24
device-app/database/factories/OwnerTransactionFactory.php
Normal file
24
device-app/database/factories/OwnerTransactionFactory.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\OwnerTransaction>
|
||||||
|
*/
|
||||||
|
class OwnerTransactionFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
*
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'rz_username' => $this->faker->name(),
|
||||||
|
'timestamp_owner_since' => $this->faker->unixTime()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Factories;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\PurchasingInformation>
|
||||||
|
*/
|
||||||
|
class PurchasingInformationFactory extends Factory
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Define the model's default state.
|
||||||
|
* @return array<string, mixed>
|
||||||
|
*/
|
||||||
|
public function definition(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'price' => $this->faker->word(),
|
||||||
|
'timestamp_warranty_end' => $this->faker->unixTime(),
|
||||||
|
'timestamp_purchase' => $this->faker->unixTime(),
|
||||||
|
'cost_centre' => $this->faker->numberBetween(1000000000, 9999999999),
|
||||||
|
'seller' => $this->faker->company()
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
@ -12,7 +12,7 @@
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('devices', function (Blueprint $table) {
|
Schema::create('devices', function (Blueprint $table) {
|
||||||
$table->string('device_id')->unique();
|
$table->uuid('device_id')->primary();
|
||||||
$table->string('title');
|
$table->string('title');
|
||||||
$table->string('device_type');
|
$table->string('device_type');
|
||||||
$table->string('description')->nullable();
|
$table->string('description')->nullable();
|
||||||
|
@ -12,11 +12,10 @@
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('location_transactions', function (Blueprint $table) {
|
Schema::create('location_transactions', function (Blueprint $table) {
|
||||||
$table->string('location_transaction_id')->unique();
|
$table->uuid('location_transaction_id')->primary();
|
||||||
$table->string('room_code');
|
$table->string('room_code');
|
||||||
$table->string('timestamp_located_since');
|
$table->string('timestamp_located_since');
|
||||||
$table->string('device_id');
|
$table->foreignUUid('device_id')->references('device_id')->on('devices')->cascadeOnUpdate()->cascadeOnDelete();
|
||||||
$table->foreign('device_id')->references('device_id')->on('devices');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,11 +12,10 @@
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('owner_transactions', function (Blueprint $table) {
|
Schema::create('owner_transactions', function (Blueprint $table) {
|
||||||
$table->string('owner_transaction_id')->unique();
|
$table->uuid('owner_transaction_id')->primary();
|
||||||
$table->string('rz_username');
|
$table->string('rz_username');
|
||||||
$table->string('timestamp_owner_since');
|
$table->string('timestamp_owner_since');
|
||||||
$table->string('device_id');
|
$table->foreignUuid('device_id')->references('device_id')->on('devices')->cascadeOnUpdate()->cascadeOnDelete();
|
||||||
$table->foreign('device_id')->references('device_id')->on('devices');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,14 +12,13 @@
|
|||||||
public function up(): void
|
public function up(): void
|
||||||
{
|
{
|
||||||
Schema::create('purchasing_information', function (Blueprint $table) {
|
Schema::create('purchasing_information', function (Blueprint $table) {
|
||||||
$table->string('purchasing_information_id')->unique();
|
$table->uuid('purchasing_information_id')->primary();
|
||||||
$table->string('price');
|
$table->string('price');
|
||||||
$table->string('timestamp_warranty_end');
|
$table->string('timestamp_warranty_end');
|
||||||
$table->string('timestamp_purchase');
|
$table->string('timestamp_purchase');
|
||||||
$table->string('cost_centre');
|
$table->string('cost_centre');
|
||||||
$table->string('seller')->nullable();
|
$table->string('seller')->nullable();
|
||||||
$table->string('device_id');
|
$table->foreignUuid('device_id')->references('device_id')->on('devices')->cascadeOnUpdate()->cascadeOnDelete();
|
||||||
$table->foreign('device_id')->references('device_id')->on('devices');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,12 +25,15 @@ public function run(): void
|
|||||||
// 'email' => 'test@example.com',
|
// 'email' => 'test@example.com',
|
||||||
// ]);
|
// ]);
|
||||||
|
|
||||||
Device::factory(1)->create([
|
//Device::factory()->has(PurchasingInformation::factory()->count(1))->create();
|
||||||
'device_id' => '1'
|
|
||||||
]);
|
Device::factory()->count(10)
|
||||||
|
->has(PurchasingInformation::factory()->count(1), 'purchasing')
|
||||||
|
->has(LocationTransaction::factory()->count(3), 'locations')
|
||||||
|
->has(OwnerTransaction::factory()->count(3), 'owners')
|
||||||
|
->create();
|
||||||
|
|
||||||
User::create([
|
User::create([
|
||||||
|
|
||||||
'rz_username' => 'admin',
|
'rz_username' => 'admin',
|
||||||
'full_name' => 'Admin',
|
'full_name' => 'Admin',
|
||||||
'organisation_unit' => '11111111',
|
'organisation_unit' => '11111111',
|
||||||
@ -45,29 +48,5 @@ public function run(): void
|
|||||||
'has_admin_privileges' => false,
|
'has_admin_privileges' => false,
|
||||||
'hashed_password' => bcrypt('test123')
|
'hashed_password' => bcrypt('test123')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
PurchasingInformation::create([
|
|
||||||
'purchasing_information_id' => '1',
|
|
||||||
'price' => '1',
|
|
||||||
'timestamp_warranty_end' => '1',
|
|
||||||
'timestamp_purchase' => '1',
|
|
||||||
'cost_centre' => '1',
|
|
||||||
'seller' => '1',
|
|
||||||
'device_id' => '1',
|
|
||||||
]);
|
|
||||||
|
|
||||||
LocationTransaction::create([
|
|
||||||
'location_transaction_id' => '1',
|
|
||||||
'room_code' => '1',
|
|
||||||
'timestamp_located_since' => '1',
|
|
||||||
'device_id' => '1',
|
|
||||||
]);
|
|
||||||
|
|
||||||
OwnerTransaction::create([
|
|
||||||
'owner_transaction_id' => '1',
|
|
||||||
'rz_username' => '1',
|
|
||||||
'timestamp_owner_since' => '1',
|
|
||||||
'device_id' => '1',
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
@props(['device'])
|
|
||||||
<div>
|
|
||||||
<a href="/devices/{{ $device['device_id'] }}">{{ $device->title }}</a>
|
|
||||||
<ul>
|
|
||||||
<li>{{ $device['device_id'] }}</li>
|
|
||||||
<li>{{ $device['title'] }}</li>
|
|
||||||
<li>{{ $device['device_type'] }}</li>
|
|
||||||
<li>{{ $device['description'] }}</li>
|
|
||||||
<li>{{ $device['accessories'] }}</li>
|
|
||||||
<li>{{ $device['rz_username_buyer'] }}</li>
|
|
||||||
<li>{{ $device['serial_number'] }}</li>
|
|
||||||
<li>{{ $device['image_url'] }}</li>
|
|
||||||
</ul>
|
|
||||||
<x-purchasing-information :device="$device" />
|
|
||||||
@php
|
|
||||||
$locationTransactions = $device->locations;
|
|
||||||
$ownerTransactins = $device->owners;
|
|
||||||
@endphp
|
|
||||||
@foreach ($locationTransactions as $location)
|
|
||||||
<x-location-transaction :location="$location" />
|
|
||||||
@endforeach
|
|
||||||
@foreach ($ownerTransactins as $owner)
|
|
||||||
<x-owner-transaction :owner="$owner" />
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
@ -0,0 +1,27 @@
|
|||||||
|
@props(['device'])
|
||||||
|
<div>
|
||||||
|
<h3>Device Detail</h3>
|
||||||
|
<ul>
|
||||||
|
<!--li>device_id: {{ $device['device_id'] }}</li-->
|
||||||
|
<li>title: {{ $device['title'] }}</li>
|
||||||
|
<li>device_type: {{ $device['device_type'] }}</li>
|
||||||
|
<li>description: {{ $device['description'] }}</li>
|
||||||
|
<li>accessories: {{ $device['accessories'] }}</li>
|
||||||
|
<li>rz_username_buyer: {{ $device['rz_username_buyer'] }}</li>
|
||||||
|
<li>serial_number: {{ $device['serial_number'] }}</li>
|
||||||
|
<li>image_url: {{ $device['image_url'] }}</li>
|
||||||
|
</ul>
|
||||||
|
<x-purchasing-information :device="$device" />
|
||||||
|
@php
|
||||||
|
$locationTransactions = $device->locations;
|
||||||
|
$ownerTransactins = $device->owners;
|
||||||
|
@endphp
|
||||||
|
<h3>Location Transactions</h3>
|
||||||
|
@foreach ($locationTransactions as $location)
|
||||||
|
<x-location-transaction :location="$location" />
|
||||||
|
@endforeach
|
||||||
|
<h3>Owner Transactions</h3>
|
||||||
|
@foreach ($ownerTransactins as $owner)
|
||||||
|
<x-owner-transaction :owner="$owner" />
|
||||||
|
@endforeach
|
||||||
|
</div>
|
@ -0,0 +1,16 @@
|
|||||||
|
@props(['device'])
|
||||||
|
<div>
|
||||||
|
<a href="/devices/{{ $device['device_id'] }}">{{ $device->title }}</a>
|
||||||
|
<ul>
|
||||||
|
<!--li>{{ $device['device_id'] }}</li-->
|
||||||
|
<!--li>title:{{ $device['title'] }}</li-->
|
||||||
|
<li>device_type: {{ $device['device_type'] }}</li>
|
||||||
|
<li>description: {{ $device['description'] }}</li>
|
||||||
|
<li>accessories: {{ $device['accessories'] }}</li>
|
||||||
|
<li>rz_username_buyer: {{ $device['rz_username_buyer'] }}</li>
|
||||||
|
<li>serial_number: {{ $device['serial_number'] }}</li>
|
||||||
|
<li>image_url: {{ $device['image_url'] }}</li>
|
||||||
|
<li>room_code: {{ $device->locations->last()['room_code'] }}</li>
|
||||||
|
<li>rz_username: {{ $device->owners->last()['rz_username'] }}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
@ -1,5 +1,4 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3>Location Transactions</h3>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>room_code: {{ $location->room_code }}</li>
|
<li>room_code: {{ $location->room_code }}</li>
|
||||||
<li>timestamp_located_since: {{ $location->timestamp_located_since }}</li>
|
<li>timestamp_located_since: {{ $location->timestamp_located_since }}</li>
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
<div>
|
<div>
|
||||||
<h3>Owner Transactions</h3>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>rz_username: {{ $owner->rz_username }}</li>
|
<li>rz_username: {{ $owner->rz_username }}</li>
|
||||||
<li>timestamp_owner_since: {{ $owner->timestamp_owner_since }}</li>
|
<li>timestamp_owner_since: {{ $owner->timestamp_owner_since }}</li>
|
||||||
|
@ -3,12 +3,12 @@
|
|||||||
@section('content')
|
@section('content')
|
||||||
<form method="POST" action="/devices">
|
<form method="POST" action="/devices">
|
||||||
@csrf
|
@csrf
|
||||||
<label for="device_id">device_id:</label>
|
<!--label for="device_id">device_id:</label>
|
||||||
<input type="text" id="device_id" name="device_id" value="{{old('device_id')}}" required>
|
<input type="text" id="device_id" name="device_id" value="{{old('device_id')}}" required>
|
||||||
@error('device_id')
|
@error('device_id')
|
||||||
<p>{{$message}}</p>
|
<p>{{$message}}</p>
|
||||||
@enderror
|
@enderror
|
||||||
<br />
|
<br /-->
|
||||||
<label for="title">Title:</label>
|
<label for="title">Title:</label>
|
||||||
<input type="text" id="title" name="title" value="{{old('title')}}" required>
|
<input type="text" id="title" name="title" value="{{old('title')}}" required>
|
||||||
@error('device_id')
|
@error('device_id')
|
||||||
|
@ -4,12 +4,12 @@
|
|||||||
<form method="POST" action="/devices/{{$device->device_id}}">
|
<form method="POST" action="/devices/{{$device->device_id}}">
|
||||||
@method('PUT')
|
@method('PUT')
|
||||||
@csrf
|
@csrf
|
||||||
<label for="device_id">device_id:</label>
|
<!--label for="device_id">device_id:</label>
|
||||||
<input type="text" id="device_id" name="device_id" value="{{$device->device_id}}" required>
|
<input type="text" id="device_id" name="device_id" value="{{$device->device_id}}" required>
|
||||||
@error('device_id')
|
@error('device_id')
|
||||||
<p>{{$message}}</p>
|
<p>{{$message}}</p>
|
||||||
@enderror
|
@enderror
|
||||||
<br />
|
<br /-->
|
||||||
<label for="title">Title:</label>
|
<label for="title">Title:</label>
|
||||||
<input type="text" id="title" name="title" value="{{$device->title}}" required>
|
<input type="text" id="title" name="title" value="{{$device->title}}" required>
|
||||||
@error('device_id')
|
@error('device_id')
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
@unless(count($devices) == 0)
|
@unless(count($devices) == 0)
|
||||||
<ul>
|
<ul>
|
||||||
@foreach ($devices as $device)
|
@foreach ($devices as $device)
|
||||||
<x-device-card :device="$device" />
|
<x-device-simple :device="$device" />
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
@else
|
@else
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
@extends('layout')
|
@extends('layout')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<h1>Device Detail</h1>
|
<x-device-detail :device="$device" />
|
||||||
|
|
||||||
<button><a href="{{$device->device_id}}/edit">Edit</a></button>
|
<button><a href="{{$device->device_id}}/edit">Edit</a></button>
|
||||||
|
|
||||||
<form method="POST" action="{{$device->device_id}}">
|
<form method="POST" action="{{$device->device_id}}">
|
||||||
@method('DELETE')
|
@method('DELETE')
|
||||||
@csrf
|
@csrf
|
||||||
|
Loading…
Reference in New Issue
Block a user