This commit is contained in:
Richard Dern
2022-01-12 00:35:37 +01:00
commit 400e3d01f1
1363 changed files with 57778 additions and 0 deletions

65
app/Models/Permission.php Executable file
View File

@@ -0,0 +1,65 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
use HasFactory;
// -------------------------------------------------------------------------
// ----| Properties |-------------------------------------------------------
// -------------------------------------------------------------------------
/**
* The attributes that are mass assignable.
*
* @var array
*/
public $fillable = [
'can_create_folder',
'can_update_folder',
'can_delete_folder',
'can_create_document',
'can_delete_document',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
public $casts = [
'can_create_folder' => 'boolean',
'can_update_folder' => 'boolean',
'can_delete_folder' => 'boolean',
'can_create_document' => 'boolean',
'can_delete_document' => 'boolean',
];
// -------------------------------------------------------------------------
// ----| Relations |--------------------------------------------------------
// -------------------------------------------------------------------------
/**
* Related user.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function user()
{
return $this->belongsTo(User::class);
}
/**
* Related folder.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function folder()
{
return $this->belongsTo(Folder::class);
}
}