38 lines
747 B
PHP
38 lines
747 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class TailorService extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $fillable = [
|
|
'user_id',
|
|
'name',
|
|
'description',
|
|
'price',
|
|
'category',
|
|
'estimated_days',
|
|
'is_available',
|
|
'service_photo'
|
|
];
|
|
|
|
protected $casts = [
|
|
'id' => 'integer',
|
|
'user_id' => 'integer',
|
|
'price' => 'decimal:2',
|
|
'estimated_days' => 'integer',
|
|
'is_available' => 'boolean'
|
|
];
|
|
|
|
/**
|
|
* Get the tailor that owns the service
|
|
*/
|
|
public function tailor()
|
|
{
|
|
return $this->belongsTo(User::class, 'user_id');
|
|
}
|
|
}
|