public function addRel($blog_id, $role_id) { Laralum::permissionToAccess('laralum.blogs.access'); $rel = Blog_Role::whereBlog_idAndRole_id($blog_id, $role_id)->first(); if (!$rel) { $rel = new Blog_Role(); $rel->blog_id = $blog_id; $rel->role_id = $role_id; $rel->save(); } }