I am returning a view in a laravel app Here is the route
Route::get('roles', 'CreateList@create');
and then in the controller
<?php
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.
error
I've alredy tried clear and config the cache
You shouldn't use full file name:
return view('roles', compact('role_id', 'name'));
https://laravel.com/docs/5.3/responses#view-responses
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With