From 2c025bb5351a84a297a62a58a1263da968905f54 Mon Sep 17 00:00:00 2001 From: Krzysztof Strzelecki Date: Fri, 31 Jan 2020 16:45:01 +0100 Subject: [PATCH] =?UTF-8?q?pojazdy,=20odznaczenia=20-=20=C5=BC=C4=85danie?= =?UTF-8?q?=20potwiedzenie=20usuni=C4=99cia?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DecorationsController.php | 4 +- app/Http/Controllers/VehiclesController.php | 4 +- resources/views/decorations.blade.php | 44 +++++++++++++++--- resources/views/equipment.blade.php | 1 + resources/views/vehicles.blade.php | 45 ++++++++++++++++--- routes/web.php | 2 + 6 files changed, 88 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/DecorationsController.php b/app/Http/Controllers/DecorationsController.php index fb4ece1..65dbdf0 100644 --- a/app/Http/Controllers/DecorationsController.php +++ b/app/Http/Controllers/DecorationsController.php @@ -67,6 +67,8 @@ class DecorationsController extends Controller { decorationsFirefighters::where('id',$id)->delete(); - return back(); + return response()->json([ + 'success' => 'Record deleted successfully!' + ]); } } diff --git a/app/Http/Controllers/VehiclesController.php b/app/Http/Controllers/VehiclesController.php index 17deb49..ee9889f 100644 --- a/app/Http/Controllers/VehiclesController.php +++ b/app/Http/Controllers/VehiclesController.php @@ -175,7 +175,9 @@ class VehiclesController extends Controller public function destroy($id) { vehicle::where('id',$id)->delete(); - return redirect()->to('/pojazdy'); + return response()->json([ + 'success' => 'Record deleted successfully!' + ]); } public function activate() diff --git a/resources/views/decorations.blade.php b/resources/views/decorations.blade.php index db432d9..a5a1448 100644 --- a/resources/views/decorations.blade.php +++ b/resources/views/decorations.blade.php @@ -1,5 +1,7 @@ @extends('layout.app') + + @section('left-menu') @parent @stop @section('center-area') + @parent @if( auth()->check()) @@ -28,15 +31,11 @@ Operacja @foreach($awardedDecorations as $awardedDecoration) -
{{ $awardedDecoration->decorationName }} {{ $awardedDecoration->dateOfAward }} - {{ csrf_field() }} - @method('DELETE') - + -
@endforeach @@ -77,3 +76,38 @@ @endif @stop + + \ No newline at end of file diff --git a/resources/views/equipment.blade.php b/resources/views/equipment.blade.php index 2500972..d83af61 100644 --- a/resources/views/equipment.blade.php +++ b/resources/views/equipment.blade.php @@ -1,6 +1,7 @@ @extends('layout.app') + @section('left-menu') @parent