缺少必需的参数

时间:2020-05-25 02:33:32

标签: php

外观\点火\异常\ ViewException 缺少[Route:menu.edit] [URI:admin / menus / edit / {user}]的必需参数。 (视图: C:\ Users \ alberto \ Documents \ Laravel \ restaurantes \ projeto \ resources \ views \ admin \ menus \ index.blade.php) http://localhost:8000/admin/menus o codigo:edit.blade.php

@extends('layouts.app')

@section('content')

    <div class="container">

        <h1>Edição de Cardápio</h1>
        <hr>
        <form action="{{route('menu.update', ['menu' => $menu->id])}}" method="post">
            {{ csrf_field() }}
            <p class="form-group">
                <label>Nome do restaurante</label>
                <input type="text" name="name" value="{{$menu->name}}" class="form-control @if($errors->has('name')) is-invalid @endif">
                @if($errors->has('name'))
                 <span class="invalid-feedback">
                    <strong>{{$errors->first('name')}}</strong>
                 </span>
                @endif
        </p>

            <p class="form-group">
                <label>Preço</label>
                <input type="text" name="price" value="{{$menu->price}}" class="form-control @if($errors->has('price')) is-invalid @endif">
                @if($errors->has('price'))
                    <span class="invalid-feedback">
                        <strong>{{$errors->first('price')}}</strong>
                    </span>
                @endif
            </p>    

            <input type="submit" value="Atualizar" class="btn btn-success btn-lg">    
        </form>

    </div>

@endsection

0 个答案:

没有答案