In this tutorial I have to implement after delete open in new tab using route.
1st step
public function DeleteBlogCategory($id)
{
BlogCategory::findOrFail($id)->delete();
$redirectUrl = route('all.blog.category');
return Redirect::away($redirectUrl)->with([
'message' => 'Blog Category Deleted Successfully',
'alert-type' => 'success',
'open-in-new-tab' => true,
]);
}
2nd step put in web.php
Route::get('/all/blog/category', 'AllBlogCategory')->name('all.blog.category');
3rd step put in blade.php
@if (session('open-in-new-tab'))
<script>
window.open("{{ route('all.blog.category') }}", "_blank");
</script>
@endif