implement uuid and make sample data factory
This commit is contained in:
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use App\Models\OwnerTransaction;
|
||||
use App\Models\LocationTransaction;
|
||||
use App\Models\PurchasingInformation;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
@@ -12,7 +13,7 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
|
||||
class Device extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasUuids;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
@@ -31,7 +32,7 @@ class Device extends Model
|
||||
*
|
||||
* @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.
|
||||
protected $keyType = 'string';
|
||||
|
@@ -3,13 +3,14 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Device;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class LocationTransaction extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasUuids;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
|
@@ -3,13 +3,14 @@
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Device;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class OwnerTransaction extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasUuids;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
|
@@ -2,13 +2,14 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class PurchasingInformation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use HasFactory, HasUuids;
|
||||
|
||||
/**
|
||||
* The table associated with the model.
|
||||
|
Reference in New Issue
Block a user