1. Go to this page and download the library: Download dev-sajid/laravel-modular 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/ */
dev-sajid / laravel-modular example snippets
return [
// Directory where modules are stored
'modules_path' => 'modules',
// Base namespace for modules
'namespace' => 'Modules',
// Whether to prefer module-specific ServiceProviders
'prefer_module_provider' => true,
];
namespace Modules\Blog\Http\Controllers;
use Illuminate\Routing\Controller;
class BlogController extends Controller
{
public function index()
{
return view('blog::index');
}
}