mirror of
https://github.com/pacnpal/thrillwiki_laravel.git
synced 2025-12-20 06:51:10 -05:00
34 lines
674 B
PHP
34 lines
674 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Traits\TrackedModel;
|
|
|
|
class Company extends Model
|
|
{
|
|
use HasFactory, TrackedModel;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'slug',
|
|
'description',
|
|
'website',
|
|
'founded_year',
|
|
'headquarters',
|
|
'status'
|
|
];
|
|
|
|
public function parks()
|
|
{
|
|
return $this->hasMany(Park::class, 'owner_id');
|
|
}
|
|
|
|
public function updateStatistics()
|
|
{
|
|
// Implementation matching Django's Company.update_statistics()
|
|
$this->loadCount('parks');
|
|
$this->save();
|
|
}
|
|
} |