Installation
To install the Mojura package into your Laravel 10+ application using Composer -
-
Open Terminal or Command Prompt in your Laravel project directory.
-
Run the following command to install the package:
# composer require innoaya/mojura
Configuration
- Run the following command to publish the configuration file.
php artisan vendor:publish --tag=mojura-config
Following is the contents of default configuration file mojura.php in Laravel, and you are free to update the values as per your need.
return [
/**
* Register routes under routes/web and routes/api
* by the service provider or not.
*/
'enable_routes' => env('MOJURA_ENABLE_ROUTES', true),
/**
* Prefix for api routes
*/
'api_routes_prefix' => env('MOJURA_API_ROUTES_PREFIX', ''),
/**
* Prefix for web routes
*/
'web_routes_prefix' => env('MOJURA_WEB_ROUTES_PREFIX', 'app'),
];
Option | Default | Action |
---|---|---|
enable_routes | true | Should the package load the routes from routes/api & routes/web? |
api_routes_prefix | '' | Prefix for registering the routes under routes/api |
web_routes_prefix | 'web' | Prefix for registering the routes under routes/web |
- Run the following command to copy stub files to resource folder.
php artisan vendor:publish --tag=mojura-stubs