mirror of https://github.com/realodix/urlhub.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
834 B
42 lines
834 B
<?php
|
|
|
|
namespace App\Http\Controllers\Dashboard;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Url;
|
|
|
|
class AllUrlController extends Controller
|
|
{
|
|
/**
|
|
* AllUrlController constructor.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->middleware('role:admin');
|
|
}
|
|
|
|
/**
|
|
* Show all short URLs created by all users.
|
|
*
|
|
* @return \Illuminate\Contracts\View\View
|
|
*/
|
|
public function view()
|
|
{
|
|
return view('backend.all-url');
|
|
}
|
|
|
|
/**
|
|
* Delete a Short URL on user (Admin) request.
|
|
*
|
|
* @param Url $url \App\Models\Url
|
|
* @return \Illuminate\Http\RedirectResponse
|
|
*/
|
|
public function delete(Url $url)
|
|
{
|
|
$url->delete();
|
|
|
|
return redirect()->back()
|
|
->withFlashSuccess(__('Link was successfully deleted.'));
|
|
}
|
|
}
|