This guide provides step-by-step instructions for setting up a Laravel application and using a custom artisan command (php artisan make:module
) to generate new modules.
Before you begin, ensure you have the following installed on your system:
- PHP (>= 8.1)
- Composer
- MySQL or other supported databases
-
Clone the repository:
git clone https://github.com/your-repo/your-laravel-project.git cd your-laravel-project
-
Install dependencies:
bash composer install
-
Environment setup:
-
Copy the
.env.example
file to.env
and update the database credentials. -
Generate a new application key:
php artisan key:generate
-
-
Run the migrations and seed the database:
php artisan migrate --seed
-
Run the application:
php artisan serve
-
Access the application:
Open your browser and navigate to `http://localhost:8000`.
The make:module
command generates a new module with the following structure:
app/
├── Modules/
│ └── ExampleModule/
│ ├── app/
│ ├── config/
│ ├── database/
│ ├── routes/
│ ├── tests/
│ ├── composer.json/
│ ├── module.json/
| └── package.json/
To generate a new module, run the following command:
php artisan make:module ExampleModule
This will create a new module named ExampleModule
in the Modules
directory.
This guide provides a step-by-step process for setting up the HRIS application and generating new modules using a custom artisan command. By following these instructions, you can quickly create a new module and customize it to suit your needs.