File: /home/jubaroyal/public_html/app/Models/Project.php
<?php
namespace App\Models;
use App\Models\Photo;
use App\Models\Client;
use App\Models\ProjectType;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Factories\HasFactory;
class Project extends Model
{
use HasFactory, SoftDeletes;
protected $guarded = [];
public function projectType(){
return $this->belongsTo(ProjectType::class, 'project_type_id')->withDefault();
}
public function client(){
return $this->belongsTo(Client::class, 'client_id')->withDefault();
}
public function photos(){
return $this->hasMany(Photo::class);
}
}