PHPackages                             aminulbd/laravel-packages - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. aminulbd/laravel-packages

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

aminulbd/laravel-packages
=========================

Packages for Laravel

0.0.2(1y ago)82.2k↑125%2[1 PRs](https://github.com/AminulBD/laravel-packages/pulls)MITPHPPHP &gt;=8.0

Since Dec 8Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/AminulBD/laravel-packages)[ Packagist](https://packagist.org/packages/aminulbd/laravel-packages)[ RSS](/packages/aminulbd-laravel-packages/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Laravel Packages
================

[](#laravel-packages)

*A simple Laravel package that provides a way to make Laravel more modular and extensible.*

Introduction
------------

[](#introduction)

The **laravel-packages** package allows you to create modular packages within your Laravel application. This helps in organizing your codebase by grouping related functionalities into separate packages, making your application more maintainable and scalable. Each package can have its own routes, controllers, views, migrations, and more.

Requirements
------------

[](#requirements)

- **Laravel** 9.x or higher
- **PHP** 8.0 or higher

Installation
------------

[](#installation)

You can install the package via Composer:

```
# Install the package
composer require aminulbd/laravel-packages

# Publish the configuration file and sample packages
php artisan vendor:publish --tag=laravel-packages
```

The `vendor:publish` command will publish the configuration file `config/packages.php` and a sample package in the `/packages` directory.

Configuration
-------------

[](#configuration)

Open the `config/packages.php` file and update the `roots` array with the paths where your packages are located. By default, the configuration is set to use the `/packages` directory of your Laravel project, but you can change or add as many paths as you need.

```
return [
    'roots' => [
        'default' => [
            'forced' => false, // force enable all packages inside this location.
            'location' => '/packages',
        ],
        // More paths...
    ],
    // Other configurations...
];
```

Creating a Package
------------------

[](#creating-a-package)

To create a package, follow these steps:

1. **Create a Package Directory**: Create a new directory for your package inside one of the paths specified in the `roots` array. For example, create `/packages/YourPackage`.
2. **Create an Index File**: Inside your package directory, create an `index.php` file. This file will return an array with package configurations.

    Example `/packages/YourPackage/index.php`:

    ```
