for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
* Class Permission
*
* @package App\Models
*/
class Permission extends Model
{
use SoftDeletes;
/** @var int */
const ID_USERS = 1;
const ID_ROLES = 2;
const ID_TASKS = 3;
/** @var bool */
public $timestamps = true;
/** @var string */
protected $table = 'permissions';
/** @var array */
protected $fillable = [
'name'
];
protected $visible = [
'id',
'name',
'rolePermissions'
protected $sortable = [
protected $searchable = [
* Role permissions.
* @return HasMany
public function rolePermissions()
return $this->hasMany(RolePermission::class, 'permission_id', 'id');
}