use Illuminate\Support\Facades\Route;
Route::get('/', 'StudentsController@index')->name('home');
Route::get('register', 'StudentsController@create')->name('create');
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class StudentsController extends Controller
{
public function index()
{
return view('layout/main');
}
public function create()
{
return view('register');
}
}
Hello,
I've been having issues with routing, each time I go to /register I get a 404 and I can't find the problem in the code.
The default route works and I tried moving the route to the top.
The route exists in php artisan route:list.
When I try to return view('register') without the controller it seems to work but I need it to work with it.
**Edit
I am trying to load my register.blade.php file which is located in the views folder and seems to work fine when I am not using the controller, the routing is in the web.php file.
Clearing the cache doesn't seem to work either.