Skip to content

Commit f7ec887

Browse files
committed
Update dislike to unlike
1 parent f05cbff commit f7ec887

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

app/Http/Controllers/ReplyController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use App\Models\Reply;
1313
use App\Models\ReplyAble;
1414
use App\Models\Thread;
15-
use App\Jobs\DislikeReply;
15+
use App\Jobs\UnlikeReply;
1616
use App\Policies\ReplyPolicy;
1717
use Illuminate\Auth\Middleware\Authenticate;
1818
use Illuminate\Http\RedirectResponse;
@@ -71,9 +71,9 @@ public function like(Reply $reply)
7171
return back();
7272
}
7373

74-
public function dislike(Reply $reply)
74+
public function unlike(Reply $reply)
7575
{
76-
$this->dispatchNow(new DislikeReply($reply, auth()->user()));
76+
$this->dispatchNow(new UnlikeReply($reply, auth()->user()));
7777

7878
return back();
7979
}

app/Jobs/DislikeReply.php renamed to app/Jobs/UnlikeReply.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@
55
use App\User;
66
use App\Models\Reply;
77

8-
class DislikeReply
8+
class UnlikeReply
99
{
1010
/**
1111
* @var \App\Models\Reply
1212
*/
1313
private $reply;
1414

1515
/**
16-
* @var \App\Jobs\User
16+
* @var \App\User
1717
*/
1818
private $user;
1919

2020
/**
2121
* Create a new job instance.
2222
*
2323
* @param \App\Models\Reply $reply
24-
* @param \App\Jobs\User $user
24+
* @param \App\User $user
2525
*/
2626
public function __construct(Reply $reply, User $user)
2727
{

routes/web.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
Route::get('replies/{reply}/edit', 'ReplyController@edit')->name('replies.edit');
7272
Route::put('replies/{reply}', 'ReplyController@update')->name('replies.update');
7373
Route::delete('replies/{reply}', 'ReplyController@delete')->name('replies.delete');
74-
Route::put('replies/{reply}/like', ['as' => 'replies.like', 'uses' => 'ReplyController@like']);
75-
Route::delete('replies/{reply}/dislike', ['as' => 'replies.dislike', 'uses' => 'ReplyController@dislike']);
74+
Route::put('replies/{reply}/like', 'ReplyController@like')->name('replies.like');
75+
Route::delete('replies/{reply}/unlike', 'ReplyController@unlike')->name('replies.unlike');
7676

7777
// Subscriptions
7878
Route::get('subscriptions/{subscription}/unsubscribe', 'SubscriptionController@unsubscribe')

0 commit comments

Comments
 (0)