Support the ongoing development of Laravel.io →
posted 6 years ago
Laravel

Hi guys,

I want call a index page on click in the <a href="{{route('company.index')}}">.

Worked with company, but that other methods not, a had ErrorException (Route [field] not defined) and InvalidArgumentException (Route [field] not defined).

Is the same code, it was not to make a mistake.

Controller

public function index()
    {
        $fields = Field::all();
        return view('adm.field.index', compact('fields'));
    }

Call View

<a href="{{route('field.index')}}">
<li>Field</li>

Route

Route::resource('field', 'FiedlController');
Last updated 2 years ago.
0

Please check your route name from php artisan route:list

Last updated 6 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.