public function testAlliance()
 {
     $permission = SlackChannelAlliance::where('alliance_id', '=', 99000006)->first();
     $artifact = AllianceList::find(99000006);
     $this->assertEquals($artifact, $permission->alliance);
 }
Example #2
0
 private function postAllianceRelation($channelId, $allianceId)
 {
     $relation = SlackChannelAlliance::where('alliance_id', '=', $allianceId)->where('channel_id', '=', $channelId)->get();
     if ($relation->count() == 0) {
         SlackChannelAlliance::create(['alliance_id' => $allianceId, 'channel_id' => $channelId]);
         return redirect()->back()->with('success', 'New slack alliance relation has been created');
     }
     return redirect()->back()->with('error', 'This relation already exists');
 }