diff --git a/app/Http/Controllers/PersonsList.php b/app/Http/Controllers/PersonsList.php index 20dfb52..94a2d84 100644 --- a/app/Http/Controllers/PersonsList.php +++ b/app/Http/Controllers/PersonsList.php @@ -61,4 +61,11 @@ function insert(Request $r) { return redirect(route('person::list'))->with('successful_insert', true); } + function edit(Request $r, $id) { + return view("persons/edit"); + } + + function update(Request $r, $id) { + } + } diff --git a/resources/views/persons/edit.blade.php b/resources/views/persons/edit.blade.php new file mode 100644 index 0000000..1385e0b --- /dev/null +++ b/resources/views/persons/edit.blade.php @@ -0,0 +1,6 @@ +@extends('layout') + +@section('title', 'Editace osoby') + +@section('content') +@endsection \ No newline at end of file diff --git a/resources/views/persons/list.blade.php b/resources/views/persons/list.blade.php index 1b28fbb..43cce56 100644 --- a/resources/views/persons/list.blade.php +++ b/resources/views/persons/list.blade.php @@ -20,6 +20,7 @@ Jméno Adresa + Editovat Smazat @foreach($persons as $person) @@ -30,6 +31,9 @@ @else Nema adresu @endif + + Editace +
{{ csrf_field() }} diff --git a/routes/web.php b/routes/web.php index 29dbb81..260ffeb 100644 --- a/routes/web.php +++ b/routes/web.php @@ -23,4 +23,7 @@ Route::get('/osoby/vytvorit', 'PersonsList@create')->name('person::create'); Route::post('/osoby/pridat', 'PersonsList@insert')->name('person::insert'); + + Route::get('/osoby/editace/{id}', 'PersonsList@edit')->name('person::edit'); + Route::post('/osoby/ulozit/{id}', 'PersonsList@update')->name('person::update'); });