public function getRemovePublic($channelId) { $channelPublic = SlackChannelPublic::where('channel_id', $channelId); if ($channelPublic != null) { $channelPublic->delete(); return redirect()->back()->with('success', 'The public slack relation has been removed'); } return redirect()->back()->with('error', 'An error occurs while trying to remove the public Slack relation.'); }
public function testChannel() { $permission = SlackChannelPublic::where('channel_id', '=', 'C1Z920QKC')->first(); $artifact = SlackChannel::find('C1Z920QKC'); $this->assertEquals($artifact, $permission->channel); }