Initial Commit; base feats

This commit is contained in:
Didier Slof 2022-11-23 09:32:34 +01:00
commit 9732135e90
Signed by: didier
GPG key ID: 01E71F18AA4398E5
137 changed files with 13856 additions and 0 deletions

27
app/Models/Permission.php Normal file
View file

@ -0,0 +1,27 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Permission extends Model
{
protected $table = 'permissions';
protected $primaryKey = 'permission_id';
protected $fillable = [
'permission_name',
];
protected $hidden = [
'created_at',
'updated_at',
];
// Permissions are linked to users by the user_permissions table
// User permissions are linked to users by the user_id and are valid per date
public function users()
{
return $this->belongsToMany(User::class, 'user_permissions', 'permission_id', 'user_id');
}
}