I'm having the issue when loading the /usarios/create (/user/create) and being return an error of:
BadMethodCallException
Method App\Http\Controllers\UserController::create does not exist.
Route web file:
Auth::routes();
Route::get('/', 'HomeController@index')->name('home');
Route::resource('usuarios', 'UserController@index');
UserController:
<?php
namespace App\Http\Controllers;
use App\User;
use Illuminate\Http\Request;
class UserController extends Controller
{
public function index()
{
$users = User::all( );
return view( 'usuarios.index', ['users' => $users]);
}
}
function create()
{
return view ('usuarios.create');
}
function store(Request $request)
{
}
function show($id)
{
}
function edit($id)
{
}
function update(Request $request, $id)
{
}
function destroy($id)
{
}
My version Laravel is 6.0
Any help? Thanks!
@index
from your resource route. Resource routes only need the controller name. – aynber