Mntfr Mntfr - 1 year ago 237
PHP Question

Laravel View not Found

I am returning a view in a laravel app Here is the route

Route::get('roles', 'CreateList@create');

and then in the controller


namespace App\Http\Controllers;

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

class CreateList extends Controller
function create(){

$roles = DB::table('sec_role')->get();
return view('roles.blade.php', compact('role_id', 'name'));


Finally I do have a roles.blade.php in my Resources/views folder
but when I go to the route I get the

InvalidArgumentException in FileViewFinder.php line 137:
View [roles.blade.php] not found.


I've alredy tried clear and config the cache

Answer Source

You shouldn't use full file name:

 return view('roles', compact('role_id', 'name'));

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download