コード例 #1
0
 public function testCorporation()
 {
     $permission = SlackChannelCorporation::where('corporation_id', '=', 98413060)->first();
     $artifact = CorporationSheet::find(98413060);
     $this->assertEquals($artifact, $permission->corporation);
 }
コード例 #2
0
 private function postCorporationRelation($channelId, $corporationId)
 {
     $relation = SlackChannelCorporation::where('corporation_id', '=', $corporationId)->where('channel_id', '=', $channelId)->get();
     if ($relation->count() == 0) {
         SlackChannelCorporation::create(['corporation_id' => $corporationId, 'channel_id' => $channelId]);
         return redirect()->back()->with('success', 'New slack corporation relation has been created');
     }
     return redirect()->back()->with('error', 'This relation already exists');
 }