PHP code example of ngarak-dev / laravel-modularization
1. Go to this page and download the library: Download ngarak-dev/laravel-modularization library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ngarak-dev / laravel-modularization example snippets
public function store(StoreProductRequest $request): RedirectResponse
{
$this->service->create($request->validated());
return redirect()->route('product.index');
}
module_path('Catalog');
module_path('Catalog', 'Http/Controllers');
modules_path();
use NgarakDev\Modularization\Facades\Modularization;
Modularization::hasModule('Catalog');
Modularization::isEnabled('Catalog');
Modularization::enable('Catalog');
Modularization::getModules();