main
This commit is contained in:
Executable
+24
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Price extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $fillable = [
|
||||
"price",
|
||||
"date_at",
|
||||
"time_at",
|
||||
"user_id"
|
||||
];
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class)->select(['id','name']);
|
||||
}
|
||||
public function order(){
|
||||
return $this->hasMany(Order::class, 'price_id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user