2020-05-19 13:35:41 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
|
|
|
|
|
|
use App\Models\ArcadiaLink;
|
2022-06-20 14:57:58 +02:00
|
|
|
use Illuminate\Support\Carbon;
|
2020-05-19 13:35:41 +02:00
|
|
|
|
|
|
|
|
class ArcadiaLinkController extends Controller
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
/**
|
|
|
|
|
* Display a listing of the resource.
|
|
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
|
*/
|
|
|
|
|
public function index()
|
2020-05-19 13:35:41 +02:00
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
/** @var \App\Models\User */
|
|
|
|
|
$user = auth()->user();
|
|
|
|
|
$user->authorizeRoles(config('roles.const.ADMIN'));
|
2022-04-19 16:07:27 +02:00
|
|
|
$dt = Carbon::now('Europe/Paris')->subMinutes(15)->toDateTimeString();
|
2020-05-19 13:35:41 +02:00
|
|
|
$ano = ArcadiaLink::where('created_at', '<', $dt)->orderBy('id', 'DESC')->get();
|
2022-06-20 14:57:58 +02:00
|
|
|
return view('arcadialinks.index', ['ano' => $ano]);
|
2020-05-19 13:35:41 +02:00
|
|
|
}
|
|
|
|
|
|
2022-06-20 14:57:58 +02:00
|
|
|
/**
|
|
|
|
|
* Remove the specified resource from storage.
|
|
|
|
|
*
|
|
|
|
|
* @param \App\Models\ArcadiaLink $arcadia_link
|
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
|
*/
|
|
|
|
|
public function delete(ArcadiaLink $arcadia_link)
|
2020-05-19 13:35:41 +02:00
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
if ($arcadia_link->deleteOrFail()) {
|
|
|
|
|
return redirect()
|
|
|
|
|
->route('arcadialinks.index')
|
|
|
|
|
->with('warning', trans(
|
|
|
|
|
':model a bien été supprimé',
|
|
|
|
|
['model' => trans('ArcadiaLink')]
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
return back();
|
2020-05-19 13:35:41 +02:00
|
|
|
}
|
|
|
|
|
}
|