Suppose we want to add our custom functionality to the Bagisto, and if we change the core files of the Bagisto this will create a problem. To solve this problem here comes the concept of overriding the function
We are here overriding Velocity Controller called ShopController in Custom Module
Copy and paste the controller into the custom module as shown below in the screenshot
Make the changes you want in the controller and save the file
Publish the controller from the Custom Service Provider as illustrated below
1 2 3 4 5 6 7 8 9 10 11 | /** * Bootstrap services. * * @return void */ public function boot(Router $router) { $this->publishes([ __DIR__ . '/../Http/Controllers/Shop/ShopController.php' => __DIR__ . '/../../../Velocity/src/Http/Controllers/Shop/ShopController.php', ]); } |
Run the Command php artisan vendor: publish –force
So, that was much about the article “ How to override controller in Bagisto ? ”. Also for any queries or doubts reach out to us at [email protected]. You can also raise a ticket at our HelpDesk System.
If you have more details or questions, you can reply to the received confirmation email.
Back to Home
Be the first to comment.