'billets' table + pages

This commit is contained in:
Clément
2025-04-15 16:29:47 +02:00
parent 9c129fc03d
commit ea0884d39f
12 changed files with 355 additions and 3 deletions

View File

@@ -0,0 +1,67 @@
<?php
namespace App\Http\Controllers;
use App\Http\Requests\StoreBilletRequest;
use App\Http\Requests\UpdateBilletRequest;
use App\Models\Billet;
class BilletController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$billets = Billet::all();
return view('index', compact('billets'));
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(StoreBilletRequest $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(Billet $billet)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(Billet $billet)
{
//
}
/**
* Update the specified resource in storage.
*/
public function update(UpdateBilletRequest $request, Billet $billet)
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy(Billet $billet)
{
//
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreBilletRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}

View File

@@ -0,0 +1,28 @@
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class UpdateBilletRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*/
public function authorize(): bool
{
return false;
}
/**
* Get the validation rules that apply to the request.
*
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
*/
public function rules(): array
{
return [
//
];
}
}

View File

@@ -0,0 +1,12 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Billet extends Model
{
/** @use HasFactory<\Database\Factories\BilletFactory> */
use HasFactory;
}

View File

@@ -0,0 +1,66 @@
<?php
namespace App\Policies;
use App\Models\Billet;
use App\Models\User;
use Illuminate\Auth\Access\Response;
class BilletPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return false;
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Billet $billet): bool
{
return false;
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Billet $billet): bool
{
return false;
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Billet $billet): bool
{
return false;
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Billet $billet): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Billet $billet): bool
{
return false;
}
}