| @@ 73-79 (lines=7) @@ | ||
| 70 | DiscussConversationValidator::create($request->all())->validate(); |
|
| 71 | ||
| 72 | // Users that have the permission "manage.discuss" can bypass this rule. (Default to Administrator) |
|
| 73 | if (DiscussConversation::isFlooding('xetaravel.flood.discuss.conversation') && |
|
| 74 | !Auth::user()->hasPermission('manage.discuss') |
|
| 75 | ) { |
|
| 76 | return back() |
|
| 77 | ->withInput() |
|
| 78 | ->with('danger', 'Wow, keep calm bro, and try to not flood !'); |
|
| 79 | } |
|
| 80 | $conversation = DiscussConversationRepository::create($request->all()); |
|
| 81 | $post = $conversation->firstPost; |
|
| 82 | ||
| @@ 33-37 (lines=5) @@ | ||
| 30 | $conversation = DiscussConversation::findOrFail($request->conversation_id); |
|
| 31 | ||
| 32 | // Users that have the permission "manage.discuss" can bypass this rule. (Default to Administrator) |
|
| 33 | if (DiscussPost::isFlooding('xetaravel.flood.discuss.post') && !Auth::user()->hasPermission('manage.discuss')) { |
|
| 34 | return back() |
|
| 35 | ->withInput() |
|
| 36 | ->with('danger', 'Wow, keep calm bro, and try to not flood !'); |
|
| 37 | } |
|
| 38 | ||
| 39 | DiscussPostValidator::create($request->all())->validate(); |
|
| 40 | $post = DiscussPostRepository::create($request->all()); |
|