29 lines
558 B
PHP
29 lines
558 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Project extends Model
|
|
{
|
|
use HasFactory;
|
|
protected $fillable = [
|
|
'name',
|
|
];
|
|
|
|
protected static function boot()
|
|
{
|
|
parent::boot(); // TODO: Change the autogenerated stub
|
|
|
|
static::deleting(function ($project) {
|
|
$project->boundingBoxes()->delete();
|
|
});
|
|
}
|
|
|
|
public function boundingBoxes()
|
|
{
|
|
return $this->hasMany(ProjectBoundingBox::class);
|
|
}
|
|
}
|