687681744a
git commit "Implement user registration"
43 lines
731 B
PHP
43 lines
731 B
PHP
<?php
|
|
|
|
/**
|
|
* Created by Reliese Model.
|
|
*/
|
|
|
|
namespace App\Models;
|
|
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Class Permission
|
|
*
|
|
* @property int $id
|
|
* @property string $name
|
|
* @property string $slug
|
|
* @property string|null $description
|
|
* @property Carbon|null $created_at
|
|
* @property Carbon|null $updated_at
|
|
*
|
|
* @property Collection|Role[] $roles
|
|
*
|
|
* @package App\Models
|
|
*/
|
|
class Permission extends Model
|
|
{
|
|
protected $table = 'permissions';
|
|
public static $snakeAttributes = false;
|
|
|
|
protected $fillable = [
|
|
'name',
|
|
'slug',
|
|
'description'
|
|
];
|
|
|
|
public function roles()
|
|
{
|
|
return $this->belongsToMany(Role::class, 'role_permissions');
|
|
}
|
|
}
|