25 lines
557 B
PHP
25 lines
557 B
PHP
<?php
|
|
|
|
namespace App\Models\Website;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Project extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'website_projects'; // نام صحیح جدول
|
|
protected $fillable = ['category_id', 'image1', 'image2'];
|
|
|
|
public function translations()
|
|
{
|
|
return $this->hasMany(ProjectTranslation::class, 'project_id');
|
|
}
|
|
|
|
public function category()
|
|
{
|
|
return $this->belongsTo(ProjectCategory::class, 'category_id');
|
|
}
|
|
}
|