R
R
Ruslan Absalyamov2018-05-06 12:11:47
Laravel
Ruslan Absalyamov, 2018-05-06 12:11:47

Why doesn't it say Missing required parameters for [Route: shedule.update] [URI: shedule/{schedule}]?

I'm trying to create an edit page through a modal window, but this error is shown to me, I just have to pass the id to it as I understand it, but why doesn't it issue
Missing required parameters for [Route: shedule.update] [URI: shedule/{schedule }]
my implementation in vushkeya is like this

<div class="block-lesson" style="width: 43.5%; height: {{ ((strtotime($lesson->time_end) - strtotime($lesson->time_start))/60/30 + 1) * 33}}px;" data-href="{{ route('shedule.edit', $lesson->id) }}">

That is, when clicked, a modal window with this address should be displayed. The address normally displays localhost:8000/schedule/30/edit.
In the controller
public function edit($id)
    {
$user = Auth::user()->id;
        $branch = Branch::where('user_id', $user)->get();
        $direction = Direction::where('user_id', Auth::user()->id)->get();
        $shedule = Shedule::find($id);
        return view('shedule.update', compact('branch', 'direction', 'shedule'));
    }

In the router
Route::resource('shedule', 'SheduleController')->middleware('auth');

And that's it, in theory it should be displayed normally with the parameters, but it says that it is missing, why I still don't understand

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ruslan Absalyamov, 2018-05-06
@rusline18

The point is in the form, as I understand it in the modal window, there is a value

<form id="form-create_shedule" action="{{ route('shedule.update') }}" method="post">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question