E
E
Elizaveta Cezurk2021-10-04 13:17:00
Laravel
Elizaveta Cezurk, 2021-10-04 13:17:00

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]);
}

Everything looks great and great.
But when I stumbled upon the PHPageBuilder page builder, I wondered if I could also give the PHPageBuilder template page product information?
The template pages are in themes/mytheme/blocks/product.php
Didn't find anything or didn't search well... Thanks in advance for your help!
PS I understand that the view helper only works with .blade.php files in a certain category, but are there any alternatives for my case?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question