- Company → Project → (Locations + Departments) hierarchy - Company CRUD (add, edit, delete) with AJAX - Projects are created under a company via inline strip - Two-column project body: Locations | Departments - Stats show companies, projects, locations, departments, active projects - Dynamic stat counters update on add/delete without page reload Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
420 B
PHP
20 lines
420 B
PHP
<?php
|
|
|
|
namespace App\Models\Settings;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Company extends Model
|
|
{
|
|
protected $table = 'settings_companies';
|
|
|
|
protected $fillable = ['name', 'is_active'];
|
|
|
|
protected $casts = ['is_active' => 'boolean'];
|
|
|
|
public function projects(): \Illuminate\Database\Eloquent\Relations\HasMany
|
|
{
|
|
return $this->hasMany(ProjectSetting::class, 'company_id');
|
|
}
|
|
}
|