Laravel 13 + Livewire/Volt app for managing client organizations, documents, passwords, flexible assets, virtual machines, contacts, domains, todos, shortcuts, and role-based user administration.
26 lines
531 B
PHP
26 lines
531 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
#[Fillable(['organization_id', 'label', 'url', 'icon', 'created_by'])]
|
|
class Shortcut extends Model
|
|
{
|
|
public function organization()
|
|
{
|
|
return $this->belongsTo(Organization::class);
|
|
}
|
|
|
|
public function creator()
|
|
{
|
|
return $this->belongsTo(User::class, 'created_by');
|
|
}
|
|
|
|
public function isGlobal(): bool
|
|
{
|
|
return $this->organization_id === null;
|
|
}
|
|
}
|