This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
21
{
22
public function __construct()
23
{
24
$this->client = new Client();
25
}
26
27
/**
28
* Shows the landing page of
29
* Laravel Slack Package
30
*
31
*/
32
public function slackPage()
33
{
34
return view('slack.slack');
35
}
36
37
/**
38
* Get Email, Validate and Send
39
* Invite to User
40
*
41
*/
42
public function sendSlackInvite(Request $request)
43
{
44
$validator= Validator::make($request->all(),[
45
'email'=>'required|email'
46
]);
47
48
if ($validator->fails())
49
{
50
return redirect()->back()->with('error','Sorry! Please enter a valid mail or you have used this mail here');
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.