implement uuid and make sample data factory
This commit is contained in:
@@ -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>
|
||||
<h3>Location Transactions</h3>
|
||||
<ul>
|
||||
<li>room_code: {{ $location->room_code }}</li>
|
||||
<li>timestamp_located_since: {{ $location->timestamp_located_since }}</li>
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<div>
|
||||
<h3>Owner Transactions</h3>
|
||||
<ul>
|
||||
<li>rz_username: {{ $owner->rz_username }}</li>
|
||||
<li>timestamp_owner_since: {{ $owner->timestamp_owner_since }}</li>
|
||||
|
@@ -3,12 +3,12 @@
|
||||
@section('content')
|
||||
<form method="POST" action="/devices">
|
||||
@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>
|
||||
@error('device_id')
|
||||
<p>{{$message}}</p>
|
||||
@enderror
|
||||
<br />
|
||||
<br /-->
|
||||
<label for="title">Title:</label>
|
||||
<input type="text" id="title" name="title" value="{{old('title')}}" required>
|
||||
@error('device_id')
|
||||
|
@@ -4,12 +4,12 @@
|
||||
<form method="POST" action="/devices/{{$device->device_id}}">
|
||||
@method('PUT')
|
||||
@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>
|
||||
@error('device_id')
|
||||
<p>{{$message}}</p>
|
||||
@enderror
|
||||
<br />
|
||||
<br /-->
|
||||
<label for="title">Title:</label>
|
||||
<input type="text" id="title" name="title" value="{{$device->title}}" required>
|
||||
@error('device_id')
|
||||
|
@@ -5,7 +5,7 @@
|
||||
@unless(count($devices) == 0)
|
||||
<ul>
|
||||
@foreach ($devices as $device)
|
||||
<x-device-card :device="$device" />
|
||||
<x-device-simple :device="$device" />
|
||||
@endforeach
|
||||
</ul>
|
||||
@else
|
||||
|
@@ -1,10 +1,9 @@
|
||||
@extends('layout')
|
||||
|
||||
@section('content')
|
||||
<h1>Device Detail</h1>
|
||||
|
||||
<button><a href="{{$device->device_id}}/edit">Edit</a></button>
|
||||
<x-device-detail :device="$device" />
|
||||
|
||||
<button><a href="{{$device->device_id}}/edit">Edit</a></button>
|
||||
<form method="POST" action="{{$device->device_id}}">
|
||||
@method('DELETE')
|
||||
@csrf
|
||||
|
Reference in New Issue
Block a user