Download the PHP package aminulbd/laravel-packages without Composer

On this page you can find all versions of the php package aminulbd/laravel-packages. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-packages

Laravel Packages

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

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

Installation

You can install the package via Composer:

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

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.

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:

  3. Set Up Autoloading: The autoload key maps your package's namespace to its source directory. This allows Laravel to autoload your package classes.

  4. Create a Service Provider: In your package's src directory, create a service provider class that extends Illuminate\Support\ServiceProvider.

    Example /packages/YourPackage/src/YourPackageServiceProvider.php:

  5. Add Package Functionality: Add your package's routes, controllers, views, migrations, etc., within the package's directory structure.

Using the Package

Once your package is set up, Laravel will automatically load it according to the configurations provided. You can use all Laravel features within your package, including routing, controllers, views, and more.

For example, to add routes in your package, you can create a routes directory and define your routes in a web.php file:

Then, in your YourPackageServiceProvider, load the routes:

Handling Package Activation

One of the powerful features of the laravel-packages package is the ability to activate or deactivate packages, for instance, from your application's admin panel. To handle package activation, you have two options:

1. Using the Configuration File

Edit the enabled key in the config/packages.php file and set its value as an array of IDs representing the packages you want to enable.

2. Using a Custom Activation Handler

Implement a class that implements the \AminulBD\Package\Laravel\PackageActivationHandler interface. This allows you to dynamically determine which packages are enabled, e.g., based on database records.

Example implementation:

Then, update your config/packages.php to use the custom activation handler:

Publishing Package Resources

If your package contains resources that need to be published to the main application (like views, configurations, assets), you can use Laravel's publishing mechanism.

In your package's service provider, add:

Consumers of your package can then publish these resources using:

Conclusion

The laravel-packages package makes it easy to create modular, self-contained packages within your Laravel application. By organizing your code into packages, you can improve maintainability, encourage code reuse, and make your application more scalable.

For more information and advanced usage, please refer to the package's repository and Laravel's official documentation on service providers and package development.


All versions of laravel-packages with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
laravel/framework Version >=9.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package aminulbd/laravel-packages contains the following files

Loading the files please wait ....