add new models and start making DB strucure
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||
|
||||
class Wishes extends Model
|
||||
{
|
||||
use HasUuids;
|
||||
|
||||
protected $table = 'wishes';
|
||||
protected $fillable = ['title', 'description', 'reward', 'owner_id', 'status', 'agent_id', 'guest_id'];
|
||||
|
||||
public function agent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'agent_id', 'uuid');
|
||||
}
|
||||
|
||||
public function owner(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'owner_id', 'uuid');
|
||||
}
|
||||
|
||||
public function guest(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Guest::class, 'guest_id', 'uuid');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user