1. Go to this page and download the library: Download dem1-off/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/ */
dem1-off / laravel-modular example snippets
#[Bind(PostRepositoryInterface::class, EloquentPostRepository::class)]
#[Listen(ChapterPublished::class, SendDigest::class)]
final class BlogServiceProvider extends ModuleServiceProvider {}
use Dem1Off\LaravelModular\Module\Attributes\Bind;
use Dem1Off\LaravelModular\Module\Attributes\Listen;
use Dem1Off\LaravelModular\Module\ModuleServiceProvider;
#[Bind(PostRepositoryInterface::class, EloquentPostRepository::class)]
#[Bind(FeedCache::class, RedisFeedCache::class, singleton: true)]
#[Listen(ChapterPublished::class, SendDigest::class)]
final class BlogServiceProvider extends ModuleServiceProvider {}
use Dem1Off\LaravelModular\Facades\Modules;
Modules::all(); // every module, keyed by name
Modules::enabled(); // only enabled ones
Modules::find('Blog'); // ModuleDescriptor|null
Modules::isEnabled('Blog');
Modules::path('Blog'); // absolute path
module_path('Blog', 'resources/views'); // path helper
public function boot(): void
{
parent::boot();
Livewire::component('blog.feed', Feed::class);
}