Роутер
Route::group(['middleware' => 'admin', 'middleware' => 'access:admin', 'prefix' => 'admin'], function () {
get('/', 'AdminController@index');
get('/addCase', 'AdminController@addCase');
post('/addCase', 'AdminController@addCasePost');
get('/editCase/{id}', 'AdminController@editCase');
get('/addItem', 'AdminController@addItem');
post('/addItem', 'AdminController@addItemPost');
get('/lastvvod', 'AdminController@lastvvod');
get('/lastvivod', 'AdminController@vivod');
get('/vivodclose/{id}', 'AdminController@close');
});
Контролер
public function editCase($id)
{
$editcase = \DB::table('case')->where('id', '=', $id);
return view('admin.editCase', compact('editcase'));
}
Вывод
@foreach($editcase as $s)
<input name="id" value="{{ $editcase->id }}" type="hidden">
<!-- Forms: Normal input field -->
<div class="control-group">
<label class="control-label" for="inputInline">Картинка</label>
<div class="controls">
<input type="file" name="image" value="{{ $s->image }}" class="input-block-level" >
</div>
</div>
@endforeach
Выдает ошибку
Undefined property: Illuminate\Database\Query\Builder::$id (View: C:\Service\OpenServer\domains\localhost\resources\views\admin\editCase.blade.php)