Skip to content

Commit

Permalink
Merge pull request #4448 from Roardom/refactor-with-success-warning-info
Browse files Browse the repository at this point in the history
  • Loading branch information
HDVinnie authored Jan 22, 2025
2 parents 64d08ec + 868ad35 commit 7f8b99a
Show file tree
Hide file tree
Showing 99 changed files with 239 additions and 239 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/ApprovedRequestFillController.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function store(Request $request, TorrentRequest $torrentRequest): \Illumi
}

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(\sprintf(trans('request.approved-user'), $torrentRequest->name, $torrentRequest->filled_anon ? 'Anonymous' : $filler->username));
->with('success', \sprintf(trans('request.approved-user'), $torrentRequest->name, $torrentRequest->filled_anon ? 'Anonymous' : $filler->username));
}

/**
Expand All @@ -102,6 +102,6 @@ public function destroy(Request $request, TorrentRequest $torrentRequest): \Illu
$filler->decrement('seedbonus', (float) $refunded);

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('request.request-reset'));
->with('success', trans('request.request-reset'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/ApplicationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public function store(StoreApplicationRequest $request): \Illuminate\Http\Redire
$application->urlProofs()->createMany($request->validated('links'));

return to_route('login')
->withSuccess(trans('auth.application-submitted'));
->with('success', trans('auth.application-submitted'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/BountyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function store(StoreTorrentRequestBountyRequest $request, TorrentRequest
}

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('request.added-bonus'));
->with('success', trans('request.added-bonus'));
}

public function update(UpdateTorrentRequestBountyRequest $request, TorrentRequest $torrentRequest, TorrentRequestBounty $torrentRequestBounty): \Illuminate\Http\RedirectResponse
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/ClaimController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function store(StoreTorrentRequestClaimRequest $request, TorrentRequest $
}

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('request.claimed-success'));
->with('success', trans('request.claimed-success'));
}

/**
Expand All @@ -78,6 +78,6 @@ public function destroy(Request $request, TorrentRequest $torrentRequest, Torren
}

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('request.unclaimed-success'));
->with('success', trans('request.unclaimed-success'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/ClaimedPrizeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function store(Request $request, Event $event): \Illuminate\Http\Redirect
'fl_tokens' => $fl_tokens_won,
]);

return to_route('events.show', ['event' => $event])->withSuccess('Congrats! You have won a prize!');
return to_route('events.show', ['event' => $event])->with('success', 'Congrats! You have won a prize!');
});
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/ContactController.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ public function store(Request $request): \Illuminate\Http\RedirectResponse
Mail::to($user->email)->send(new Contact($request->string('email')));

return to_route('home.index')
->withSuccess('Your Message Was Successfully Sent');
->with('success', 'Your Message Was Successfully Sent');
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/DonationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ public function store(StoreDonationRequest $request)
]);

return redirect()->route('donations.index')
->withSuccess('Thank You For Supporting Us! Please allow for up to 48 hours for staff to confirm the transaction.');
->with('success', 'Thank You For Supporting Us! Please allow for up to 48 hours for staff to confirm the transaction.');
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/PlaylistController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function store(StorePlaylistRequest $request): \Illuminate\Http\RedirectR
}

return to_route('playlists.show', ['playlist' => $playlist])
->withSuccess(trans('playlist.published-success'));
->with('success', trans('playlist.published-success'));
}

/**
Expand Down Expand Up @@ -162,7 +162,7 @@ public function update(UpdatePlaylistRequest $request, Playlist $playlist): \Ill
}

return to_route('playlists.show', ['playlist' => $playlist])
->withSuccess(trans('playlist.update-success'));
->with('success', trans('playlist.update-success'));
}

/**
Expand All @@ -179,6 +179,6 @@ public function destroy(Request $request, Playlist $playlist): \Illuminate\Http\
$playlist->delete();

return to_route('playlists.index')
->withSuccess(trans('playlist.deleted'));
->with('success', trans('playlist.deleted'));
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/PlaylistTorrentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function store(StorePlaylistTorrentRequest $request): \Illuminate\Http\Re
$playlistTorrent->torrent()->searchable();

return to_route('playlists.show', ['playlist' => $playlist])
->withSuccess(trans('playlist.attached-success'));
->with('success', trans('playlist.attached-success'));
}

/**
Expand Down Expand Up @@ -74,7 +74,7 @@ public function massUpsert(MassUpsertPlaylistTorrentRequest $request): \Illumina
$playlist->torrents()->searchable();

return to_route('playlists.show', ['playlist' => $playlist])
->withSuccess(trans('playlist.attached-success'));
->with('success', trans('playlist.attached-success'));
}

/**
Expand All @@ -91,6 +91,6 @@ public function destroy(Request $request, PlaylistTorrent $playlistTorrent): \Il
$playlistTorrent->torrent()->searchable();

return to_route('playlists.show', ['playlist' => $playlistTorrent->playlist])
->withSuccess(trans('playlist.detached-success'));
->with('success', trans('playlist.detached-success'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/PollVoteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function store(StorePollVoteRequest $request, Poll $poll): \Illuminate\Ht
);

return to_route('polls.votes.index', ['poll' => $poll])
->withSuccess(trans('poll.vote-counted'));
->with('success', trans('poll.vote-counted'));
}

/**
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/PostController.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function store(Request $request): \Illuminate\Http\RedirectResponse
Notification::send($users, new NewPostTag($post));

return redirect()->to($realUrl)
->withSuccess(trans('forum.reply-topic-success'));
->with('success', trans('forum.reply-topic-success'));
}

/**
Expand Down Expand Up @@ -211,7 +211,7 @@ public function update(Request $request, int $id): \Illuminate\Http\RedirectResp
]);

return redirect()->to($postUrl)
->withSuccess(trans('forum.edit-post-success'));
->with('success', trans('forum.edit-post-success'));
}

/**
Expand Down Expand Up @@ -262,10 +262,10 @@ public function destroy(Request $request, int $id): \Illuminate\Http\RedirectRes

if ($isTopicDeleted === true) {
return to_route('forums.show', ['id' => $forum->id])
->withSuccess(trans('forum.delete-post-success'));
->with('success', trans('forum.delete-post-success'));
}

return to_route('topics.show', ['id' => $post->topic->id])
->withSuccess(trans('forum.delete-post-success'));
->with('success', trans('forum.delete-post-success'));
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/ReportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function request(Request $request, int $id): \Illuminate\Http\RedirectRes
]);

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('user.report-sent'));
->with('success', trans('user.report-sent'));
}

/**
Expand Down Expand Up @@ -86,7 +86,7 @@ public function torrent(Request $request, int $id): \Illuminate\Http\RedirectRes
]);

return to_route('torrents.show', ['id' => $id])
->withSuccess(trans('user.report-sent'));
->with('success', trans('user.report-sent'));
}

/**
Expand Down Expand Up @@ -116,6 +116,6 @@ public function user(Request $request, string $username): \Illuminate\Http\Redir
]);

return to_route('users.show', ['user' => $reportedUser])
->withSuccess(trans('user.report-sent'));
->with('success', trans('user.report-sent'));
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/RequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public function store(StoreTorrentRequestRequest $request): \Illuminate\Http\Red
}

return to_route('requests.index')
->withSuccess(trans('request.added-request'));
->with('success', trans('request.added-request'));
}

/**
Expand Down Expand Up @@ -229,7 +229,7 @@ public function update(UpdateTorrentRequestRequest $request, TorrentRequest $tor
}

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('request.edited-request'));
->with('success', trans('request.edited-request'));
}

/**
Expand Down Expand Up @@ -259,6 +259,6 @@ public function destroy(Request $request, TorrentRequest $torrentRequest): \Illu
$torrentRequest->delete();

return to_route('requests.index')
->withSuccess(\sprintf(trans('request.deleted'), $torrentRequest->name));
->with('success', \sprintf(trans('request.deleted'), $torrentRequest->name));
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/RequestFillController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function store(StoreRequestFillRequest $request, TorrentRequest $torrentR
}

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('request.pending-approval'));
->with('success', trans('request.pending-approval'));
}

/**
Expand All @@ -82,6 +82,6 @@ public function destroy(Request $request, TorrentRequest $torrentRequest): \Illu
}

return to_route('requests.show', ['torrentRequest' => $torrentRequest])
->withSuccess(trans('request.request-reset'));
->with('success', trans('request.request-reset'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/ReseedController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function store(Request $request, int $id): \Illuminate\Http\RedirectRespo
);

return to_route('torrents.show', ['id' => $torrent->id])
->withSuccess('A notification has been sent to all users that downloaded this torrent along with original uploader!');
->with('success', 'A notification has been sent to all users that downloaded this torrent along with original uploader!');
}

return to_route('torrents.show', ['id' => $torrent->id])
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/RssController.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function store(Request $request): \Illuminate\Http\RedirectResponse|\Illu
$rss->save();

return to_route('rss.index', ['hash' => 'private'])
->withSuccess(trans('rss.created'));
->with('success', trans('rss.created'));
}

return to_route('rss.create')
Expand Down Expand Up @@ -290,7 +290,7 @@ public function update(Request $request, int $id): \Illuminate\Http\RedirectResp
$rss->save();

return to_route('rss.index', ['hash' => 'private'])
->withSuccess(trans('rss.created'));
->with('success', trans('rss.created'));
}

return to_route('rss.create', ['id' => $id])
Expand All @@ -312,6 +312,6 @@ public function destroy(Request $request, int $id): \Illuminate\Http\RedirectRes
$rss->delete();

return to_route('rss.index', ['hash' => 'private'])
->withSuccess(trans('rss.deleted'));
->with('success', trans('rss.deleted'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/SimilarTorrentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,6 @@ public function update(Request $request, Category $category, int $tmdbId): \Illu
break;
}

return back()->withSuccess('Metadata update queued successfully.');
return back()->with('success', 'Metadata update queued successfully.');
}
}
4 changes: 2 additions & 2 deletions app/Http/Controllers/Staff/ApplicationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function approve(ApproveApplicationRequest $request, int $id): \Illuminat
Mail::to($application->email)->send(new InviteUser($invite));

return to_route('staff.applications.index')
->withSuccess('Application Approved');
->with('success', 'Application Approved');
}

/**
Expand All @@ -94,6 +94,6 @@ public function reject(RejectApplicationRequest $request, int $id): \Illuminate\
Mail::to($application->email)->send(new DenyApplication($request->deny));

return to_route('staff.applications.index')
->withSuccess('Application Rejected');
->with('success', 'Application Rejected');
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/Staff/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function store(StoreArticleRequest $request): \Illuminate\Http\RedirectRe
Article::create(['user_id' => $request->user()->id, 'image' => $filename ?? null] + $request->validated());

return to_route('staff.articles.index')
->withSuccess('Your article has successfully published!');
->with('success', 'Your article has successfully published!');
}

/**
Expand Down Expand Up @@ -98,7 +98,7 @@ public function update(UpdateArticleRequest $request, Article $article): \Illumi
$article->update(['image' => $filename ?? null,] + $request->validated());

return to_route('staff.articles.index')
->withSuccess('Your article changes have successfully published!');
->with('success', 'Your article changes have successfully published!');
}

/**
Expand All @@ -112,6 +112,6 @@ public function destroy(Article $article): \Illuminate\Http\RedirectResponse
$article->delete();

return to_route('staff.articles.index')
->withSuccess('Article has successfully been deleted');
->with('success', 'Article has successfully been deleted');
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Staff/AuditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ public function destroy(Audit $audit): \Illuminate\Http\RedirectResponse
$audit->delete();

return to_route('staff.audits.index')
->withSuccess('Audit Record Has Successfully Been Deleted');
->with('success', 'Audit Record Has Successfully Been Deleted');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function store(StoreAutomaticTorrentFreeleechRequest $request): \Illumina
AutomaticTorrentFreeleech::create($request->validated());

return to_route('staff.automatic_torrent_freeleeches.index')
->withSuccess('Resolution Successfully Added');
->with('success', 'Resolution Successfully Added');
}

public function edit(AutomaticTorrentFreeleech $automaticTorrentFreeleech): \Illuminate\Contracts\View\Factory|\Illuminate\View\View
Expand All @@ -65,14 +65,14 @@ public function update(UpdateAutomaticTorrentFreeleechRequest $request, Automati
$automaticTorrentFreeleech->update($request->validated());

return to_route('staff.automatic_torrent_freeleeches.index')
->withSuccess('Resolution Successfully Modified');
->with('success', 'Resolution Successfully Modified');
}

public function destroy(AutomaticTorrentFreeleech $automaticTorrentFreeleech): \Illuminate\Http\RedirectResponse
{
$automaticTorrentFreeleech->delete();

return to_route('staff.automatic_torrent_freeleeches.index')
->withSuccess('Resolution Successfully Deleted');
->with('success', 'Resolution Successfully Deleted');
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Staff/BanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ public function store(StoreBanRequest $request): \Illuminate\Http\RedirectRespon
$user->notify(new UserBan($ban));

return to_route('users.show', ['user' => $user])
->withSuccess('User Is Now Banned!');
->with('success', 'User Is Now Banned!');
}
}
6 changes: 3 additions & 3 deletions app/Http/Controllers/Staff/BlacklistClientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function update(UpdateBlacklistClientRequest $request, BlacklistClient $b
cache()->forget('client_blacklist');

return to_route('staff.blacklisted_clients.index')
->withSuccess('Blacklisted Client Was Updated Successfully!');
->with('success', 'Blacklisted Client Was Updated Successfully!');
}

/**
Expand All @@ -90,7 +90,7 @@ public function store(StoreBlacklistClientRequest $request): \Illuminate\Http\Re
cache()->forget('client_blacklist');

return to_route('staff.blacklisted_clients.index')
->withSuccess('Blacklisted Client Stored Successfully!');
->with('success', 'Blacklisted Client Stored Successfully!');
}

/**
Expand All @@ -105,6 +105,6 @@ public function destroy(BlacklistClient $blacklistClient): \Illuminate\Http\Redi
cache()->forget('client_blacklist');

return to_route('staff.blacklisted_clients.index')
->withSuccess('Blacklisted Client Destroyed Successfully!');
->with('success', 'Blacklisted Client Destroyed Successfully!');
}
}
Loading

0 comments on commit 7f8b99a

Please sign in to comment.