1. Go to this page and download the library: Download hussiensulyman/modulate 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/ */
hussiensulyman / modulate example snippets
// ❌ Never — direct cross-module model access
$course = \App\Modules\Course\Models\Course::find($id);
// ✅ Always — through a published contract
$course = app(CourseRepositoryInterface::class)->find($id);
// Need data from another module → contract
$user = app(UserServiceInterface::class)->find($userId);
// Something happened → event
event(new SubscriptionActivated($userId, $planId));
bash
php artisan modulate:make Course --minimal # bare bones, single routes.php, no Events/Listeners/Resources
php artisan modulate:make Course --api-only # no web routes or Web/ controllers