Loading app/Http/Controllers/ModificationDives.php +5 −2 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use Illuminate\View\View; use App\Models\DivingSession; use App\Models\Registration; class ModificationDives extends Controller { Loading @@ -24,8 +25,10 @@ function index(): View { return view('modification_dives', ['dives' => $request]); } static function removalOfAMemberFromASession(){ static function removalOfAMemberFromASession(string $ds_code, int $us_id){ Registration::where('car_registration.ds_code', '=', $ds_code) ->where('car_registration.us_id', '=', $us_id) ->delete(); } static function modificationMembers(string $ds_code){ Loading app/Models/Registration.php 0 → 100644 +14 −0 Original line number Diff line number Diff line <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Registration extends Model { use HasFactory; protected $table = 'CAR_REGISTRATION'; } resources/views/modification_members_of_session.blade.php +4 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ <tbody> @foreach ($persons as $person) <form method="POST" action='/modificationdives/members/{{$sessionplongee[0]['DS_CODE']}}/deletion/{{$person['US_ID']}}'> <tr class="odd:bg-white even:bg-gray-50 border-b"> <td class="px-6 py-4">{{ $person['us_name'] }}</td> <td class="px-6 py-4">{{ $person['us_first_name'] }}</td> Loading @@ -31,13 +32,14 @@ </td> <td class="px-6 py-4">{{$person['US_SUB_DATE']}}</td> <td class="px-6 py-4"> <a href='/modificationdives/members/{{$sessionplongee[0]['DS_CODE']}}' method="POST"> <x-button color="bg-red-500" colorHover="hover:bg-red-600"> <a> <x-button type="submit" color="bg-red-500" colorHover="hover:bg-red-600"> supprimer </x-button> </a> </td> </tr> </form> @endforeach <tr class="odd:bg-white even:bg-gray-50 border-b"> Loading routes/web.php +2 −2 Original line number Diff line number Diff line Loading @@ -108,6 +108,6 @@ return ModificationDives::modificationMembers($ds_code); }); Route::post('modificationdives/members/{ds_code}/deletion', function($ds_code, Request $request){ Route::post('modificationdives/members/{ds_code}/deletion/{us_id}', function($ds_code, $us_id){ ModificationDives::removalOfAMemberFromASession($ds_code, $us_id); }); No newline at end of file Loading
app/Http/Controllers/ModificationDives.php +5 −2 Original line number Diff line number Diff line Loading @@ -5,6 +5,7 @@ use Illuminate\View\View; use App\Models\DivingSession; use App\Models\Registration; class ModificationDives extends Controller { Loading @@ -24,8 +25,10 @@ function index(): View { return view('modification_dives', ['dives' => $request]); } static function removalOfAMemberFromASession(){ static function removalOfAMemberFromASession(string $ds_code, int $us_id){ Registration::where('car_registration.ds_code', '=', $ds_code) ->where('car_registration.us_id', '=', $us_id) ->delete(); } static function modificationMembers(string $ds_code){ Loading
app/Models/Registration.php 0 → 100644 +14 −0 Original line number Diff line number Diff line <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; class Registration extends Model { use HasFactory; protected $table = 'CAR_REGISTRATION'; }
resources/views/modification_members_of_session.blade.php +4 −2 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ <tbody> @foreach ($persons as $person) <form method="POST" action='/modificationdives/members/{{$sessionplongee[0]['DS_CODE']}}/deletion/{{$person['US_ID']}}'> <tr class="odd:bg-white even:bg-gray-50 border-b"> <td class="px-6 py-4">{{ $person['us_name'] }}</td> <td class="px-6 py-4">{{ $person['us_first_name'] }}</td> Loading @@ -31,13 +32,14 @@ </td> <td class="px-6 py-4">{{$person['US_SUB_DATE']}}</td> <td class="px-6 py-4"> <a href='/modificationdives/members/{{$sessionplongee[0]['DS_CODE']}}' method="POST"> <x-button color="bg-red-500" colorHover="hover:bg-red-600"> <a> <x-button type="submit" color="bg-red-500" colorHover="hover:bg-red-600"> supprimer </x-button> </a> </td> </tr> </form> @endforeach <tr class="odd:bg-white even:bg-gray-50 border-b"> Loading
routes/web.php +2 −2 Original line number Diff line number Diff line Loading @@ -108,6 +108,6 @@ return ModificationDives::modificationMembers($ds_code); }); Route::post('modificationdives/members/{ds_code}/deletion', function($ds_code, Request $request){ Route::post('modificationdives/members/{ds_code}/deletion/{us_id}', function($ds_code, $us_id){ ModificationDives::removalOfAMemberFromASession($ds_code, $us_id); }); No newline at end of file