Esempio n. 1
0
 public function testRole()
 {
     $permission = SlackChannelRole::where('role_id', '=', 1)->first();
     $artifact = Role::find(1);
     $this->assertEquals($artifact, $permission->role);
 }
Esempio n. 2
0
 private function postRoleRelation($channelId, $roleId)
 {
     $relation = SlackChannelRole::where('role_id', '=', $roleId)->where('channel_id', '=', $channelId)->get();
     if ($relation->count() == 0) {
         SlackChannelRole::create(['role_id' => $roleId, 'channel_id' => $channelId]);
         return redirect()->back()->with('success', 'New slack role relation has been created');
     }
     return redirect()->back()->with('error', 'This relation already exists');
 }