Answer the question
In order to leave comments, you need to log in
How to pass data to laravel public php file?
Hello!
I recently started learning Laravel for myself.
Here is a typical example of displaying products on the homepage
get('/', 'App\Http\Controllers\[email protected]')->name('index');
// В MainController
public function index(){
$products = Product::get();
return view('index', ['products'=>$products]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question