A Laravel-based multi-tenant application template that allows multiple organizations to use the same application instance while maintaining data isolation.
- Multi-tenant architecture with domain-based separation
- Built-in authentication system with password reset functionality
- Tenant-aware database queries and models
- Asset compilation with Laravel Mix
- Testing environment setup
- CORS support
- Modern frontend setup with Bootstrap and Axios
Before you begin, ensure you have the following installed:
- Windows: Download the PHP installer from php.net and follow the installation instructions.
- macOS: Use Homebrew:
brew install php
- Linux: Use your distribution's package manager. For example, on Ubuntu:
sudo apt update sudo apt install php8.1
- All Platforms: Follow the instructions on the Composer website to download and install Composer globally.
- Windows/macOS/Linux: Download the installer from the Node.js website and follow the installation instructions. This will install both Node.js and NPM.
- Windows/macOS/Linux: Download and install MySQL from the MySQL website or MariaDB from the MariaDB website.
- Windows: Download and install Git from git-scm.com.
- macOS: Use Homebrew:
brew install git
- Linux: Use your distribution's package manager. For example, on Ubuntu:
sudo apt update sudo apt install git
-
Clone the Repository
git clone https://github.com/your-username/your-repo-name.git cd your-repo-name
-
Install PHP Dependencies
composer install
-
Install Node.js Dependencies
npm install
-
Compile Assets
npm run dev
-
Copy the Example Environment File
cp .env.example .env
-
Generate Application Key
php artisan key:generate
-
Configure Database Settings
- Open the
.env
file and update the following lines with your database credentials:DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=your_database_name DB_USERNAME=your_database_user DB_PASSWORD=your_database_password
- Open the
-
Run Database Migrations
php artisan migrate
-
Start the Development Server
php artisan serve
-
Access the Application
- Open your web browser and go to
http://localhost:8000
- Open your web browser and go to
Here's an overview of the project's folder structure:
your-repo-name/
├── app/
│ ├── Console/
│ ├── Exceptions/
│ ├── Http/
│ │ ├── Controllers/
│ │ ├── Middleware/
│ ├── Models/
│ ├── Providers/
│ └── ...
├── bootstrap/
├── config/
├── database/
│ ├── factories/
│ ├── migrations/
│ ├── seeders/
├── public/
├── resources/
│ ├── js/
│ ├── lang/
│ ├── sass/
│ └── views/
├── routes/
│ ├── api.php
│ ├── channels.php
│ ├── console.php
│ └── web.php
├── storage/
│ ├── app/
│ ├── framework/
│ └── logs/
├── tests/
│ ├── Feature/
│ └── Unit/
├── vendor/
├── .env.example
├── artisan
├── composer.json
├── package.json
└── webpack.mix.js
- app/: Core application code, including models, controllers, and middleware.
- bootstrap/: Framework bootstrap files.
- config/: Configuration files.
- database/: Migrations, factories, and seeders.
- public/: Publicly accessible assets and front controller.
- resources/: Views, raw assets, and language files.
- routes/: Route definitions.
- storage/: Compiled templates, sessions, caches, and logs.
- tests/: Automated tests.
- vendor/: Composer dependencies.
-
Testing: To run tests, use the following command:
php artisan test
-
CORS Configuration: If you need to configure CORS, you can do so in the
config/cors.php
file. -
Environment Variables: Ensure all necessary environment variables are set in your
.env
file for proper application functionality. -
Contributing: If you wish to contribute, please fork the repository and submit a pull request.
-
License: This project is licensed under the MIT License.
For any further questions or issues, please refer to the project's issue tracker or contact the maintainers.