Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
C opencart did not work, but in Laravel, connecting one controller to another sounds crazy.
You can create a parent and inherit from it.
But .. I highly do not recommend dragging approaches from opencart to Laravel.
Read the Laravel documentation (in English), then again.
After expanding your horizons, you will receive a solution to your tasks, but through Laravel tools.
I found a solution, but I don’t know if it is correct:
1. I created a HeaderController controller that inherits Controller
2. In the desired controller, I connect the header as new HeaderController(), and then I call the index method that returns the already prepared html
3. In the template {!! $header!!}
https://laravel.com/docs/8.x/blade#components
Here are the components
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question