i have a file called "index.blade" in a view inside a folder name "home". now i am trying to make that folder as my front end for 127.0.0.1:8000 . it is showing me error as tried to give routes.
i have tried to used controller named FrontendController to provide route
ErrorException (E_ERROR) Undefined variable: students (View: D:\xampp\htdocs\Student01\resources\views\home\index.blade.php)
issue with students variable.
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Students;
class FrontendController extends Controller
{
public function index()
{
$students = Students::get();
return view('home.index', compact('students'));
}
}
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