Misc changes
This commit is contained in:
@@ -41,7 +41,7 @@ class AlertController extends Controller
|
||||
*/
|
||||
public function delete(int $alert_id): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
Alert::where('id', $alert_id)->forceDelete();
|
||||
Alert::where('id', $alert_id)->delete();
|
||||
|
||||
cache()->forget('alerts');
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@ class SiteBackgroundController extends Controller
|
||||
DB::beginTransaction();
|
||||
|
||||
$bg = SiteBackground::where('id', $id)->firstOrFail();
|
||||
$bg->forceDelete();
|
||||
$bg->delete();
|
||||
|
||||
$resolutions = [1440, 1080, 720, 640];
|
||||
try {
|
||||
|
||||
@@ -38,7 +38,7 @@ class SubtitleController extends Controller
|
||||
|
||||
// Clear everything
|
||||
foreach($episode->subtitles as $sub) {
|
||||
$sub->forceDelete();
|
||||
$sub->delete();
|
||||
}
|
||||
|
||||
if (! $request->input('subtitles')) {
|
||||
|
||||
@@ -32,7 +32,7 @@ class NotificationController extends Controller
|
||||
->where('id', $request->input('id'))
|
||||
->firstOrFail();
|
||||
|
||||
$notification->forceDelete();
|
||||
$notification->delete();
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
@@ -105,13 +105,11 @@ class PlaylistController extends Controller
|
||||
|
||||
$user = $request->user();
|
||||
|
||||
$playlist = Playlist::where('user_id', $user->id)->where('id', $playlist_id)->firstOrFail();
|
||||
$playlist = Playlist::where('user_id', $user->id)
|
||||
->where('id', $playlist_id)
|
||||
->firstOrFail();
|
||||
|
||||
// Delete Playlist Episodes
|
||||
PlaylistEpisode::where('playlist_id', $playlist->id)->forceDelete();
|
||||
|
||||
// Delete Playlist
|
||||
$playlist->forceDelete();
|
||||
$playlist->delete();
|
||||
|
||||
return to_route('profile.playlists');
|
||||
}
|
||||
@@ -128,8 +126,14 @@ class PlaylistController extends Controller
|
||||
], 404);
|
||||
}
|
||||
|
||||
$playlist = Playlist::where('user_id', $request->user()->id)->where('id', (int) $request->input('playlist'))->firstOrFail();
|
||||
PlaylistEpisode::where('playlist_id', $playlist->id)->where('episode_id', (int) $request->input('episode'))->forceDelete();
|
||||
$playlist = Playlist::where('user_id', $request->user()->id)
|
||||
->where('id', (int) $request->input('playlist'))
|
||||
->firstOrFail();
|
||||
|
||||
PlaylistEpisode::where('playlist_id', $playlist->id)
|
||||
->where('episode_id', (int) $request->input('episode'))
|
||||
->delete();
|
||||
|
||||
$this->playlistService->reorderPositions($playlist);
|
||||
|
||||
return response()->json([
|
||||
|
||||
@@ -152,13 +152,6 @@ class ProfileController extends Controller
|
||||
]);
|
||||
}
|
||||
|
||||
// Delete Playlist
|
||||
$playlists = Playlist::where('user_id', $user->id)->get();
|
||||
foreach($playlists as $playlist) {
|
||||
PlaylistEpisode::where('playlist_id', $playlist->id)->forceDelete();
|
||||
$playlist->forceDelete();
|
||||
}
|
||||
|
||||
// Update comments to deleted user
|
||||
DB::table('comments')->where('commenter_id', '=', $user->id)->update(['commenter_id' => 1]);
|
||||
|
||||
@@ -169,7 +162,7 @@ class ProfileController extends Controller
|
||||
|
||||
Auth::logout();
|
||||
|
||||
$user->forceDelete();
|
||||
$user->delete();
|
||||
|
||||
$request->session()->invalidate();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user