标签:角色 维护 批量操作 mis guard 建模 编写 结构 exe
f:\xampp\php\php.exe artisan make:model Model\Role
f:\xampp\php\php.exe artisan make:model Model\Permission
class Role extends Model
{
//1.关联的数据表
public $table = ‘role‘;
//2.主键
public $primaryKey = ‘id‘;
//3.允许批量操作的字段
//不允许的为空,意思是都允许
public $guarded = [];
//4.是否维护crated_at和updated_at字段
public $timestamps = false;
}
class Permission extends Model
{
//1.关联的数据表
public $table = ‘permission‘;
//2.主键
public $primaryKey = ‘id‘;
//3.允许批量操作的字段
//不允许的为空,意思是都允许
public $guarded = [];
//4.是否维护crated_at和updated_at字段
public $timestamps = false;
}
Route::resource(‘role‘,‘RoleController‘);
Route::resource(‘permission‘,‘PermissionController‘);
f:\xampp\php\php.exe artisan make:controller Admin/RoleController --resource
f:\xampp\php\php.exe artisan make:controller Admin/PermissionController --resource
标签:角色 维护 批量操作 mis guard 建模 编写 结构 exe
原文地址:https://www.cnblogs.com/fangsheng90/p/14087821.html