Compare commits
2 Commits
developp
...
gestion_de
| Author | SHA1 | Date | |
|---|---|---|---|
| 2f2e0f78e9 | |||
|
|
f4aa84a82d |
@@ -6,6 +6,8 @@ use App\Http\Requests\StoreBilletRequest;
|
|||||||
use App\Http\Requests\UpdateBilletRequest;
|
use App\Http\Requests\UpdateBilletRequest;
|
||||||
use App\Models\Billet;
|
use App\Models\Billet;
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Log;
|
||||||
|
|
||||||
class BilletController extends Controller
|
class BilletController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@@ -13,7 +15,13 @@ class BilletController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$billets = Billet::all();
|
Log::info("coucou");
|
||||||
|
try {
|
||||||
|
$billets = Billet::all();
|
||||||
|
} catch (\Illuminate\Database\QueryException $e) {
|
||||||
|
Log::channel('projectError')->error('Erreur d\'accès à la base de données');
|
||||||
|
return view('errors.unavailable');
|
||||||
|
}
|
||||||
return view('index', compact('billets'));
|
return view('index', compact('billets'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,12 @@ return [
|
|||||||
'path' => storage_path('logs/laravel.log'),
|
'path' => storage_path('logs/laravel.log'),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
"projectError" => [
|
||||||
|
'driver' => 'single',
|
||||||
|
'path' => storage_path('logs/project.log'),
|
||||||
|
'level' => 'error',
|
||||||
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|||||||
4
laravel/resources/views/errors/404.blade.php
Normal file
4
laravel/resources/views/errors/404.blade.php
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@extends('layout')
|
||||||
|
@section('contenu')
|
||||||
|
<h2>La page demandée n'est pas disponible</h2>
|
||||||
|
@endsection
|
||||||
4
laravel/resources/views/errors/unavailable.blade.php
Normal file
4
laravel/resources/views/errors/unavailable.blade.php
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
@extends('layout')
|
||||||
|
@section('contenu')
|
||||||
|
<h2>La ressource demandée n'est pas disponible</h2>
|
||||||
|
@endsection
|
||||||
0
laravel/storage/app/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/private/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/private/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/public/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/app/public/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/data/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/cache/data/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/sessions/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/sessions/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/testing/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/testing/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/views/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/framework/views/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/logs/.gitignore
vendored
Normal file → Executable file
0
laravel/storage/logs/.gitignore
vendored
Normal file → Executable file
Reference in New Issue
Block a user