A
A
Andrey Kornev2016-11-14 06:57:18
Laravel
Andrey Kornev, 2016-11-14 06:57:18

Laravel can't find the route! Where to dig?

There is a route

Route::group(['prefix' => 'admin', 'middleware' => ['menu']], function () {
    Route::resource('/event/', 'EventController', [ 'except' => [ 'show' ] ]);
});

in the blade I generate a link to the action
<td><a href="{{ action( '[email protected]', [$event->id] ) }}">{{ $event->id }}</a></td>

the route in the list is php artisan route:list
GET|HEAD  | admin/event/{}/edit    | edit    | App\Http\Controllers\[email protected] | web,menu

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Input;

class EventController extends Controller
{
 
    /**
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        $event = null; //Event::find($id);
        return view('admin.event_detail', ['event' => $event ] );
    }
}

But when I go to the link domain.ru/admin/event/12/edit - error 404
help, I don't know what to do anymore.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hakkol, 2016-11-14
@hakkol

Make sure that the correct middleware is specified in the routes (or whatever you hide there).
PS add code to the question not with pictures, but with code

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question