Download the PHP package elfsundae/laravel-apps without Composer

On this page you can find all versions of the php package elfsundae/laravel-apps. 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-apps

Laravel Apps

Latest Version on Packagist tests StyleCI SymfonyInsight Grade Quality Score Code Coverage Total Downloads

This package provides basic support for Laravel multi-application.

Installation

You can install this package using the Composer manager:

For earlier Laravel than v5.5, you need to register the service provider manually:

Then publish the configuration file to your config directory:

Configuration

The url configuration option defines the root URL of each application:

The providers array lists the class names of service providers for each application, you may configure this to selectively register service providers.

The config option may be used to override the default configurations for each application. Additionally, you may wish to put all of your application defaults in one place instead of editing separate configuration files, just put them in the default key:

Usage

Obtain Application Manager Instance

You may obtain the application manager instance using the Apps facade, the apps() helper function or injecting the ElfSundae\Apps\AppManager dependency.

Retrieve Application URL Configuration

Determine The Current Application Identifier

The application identifier to the current request can be determined via the id method on the app manager, or using the corresponding app_id helper function:

You may also pass arguments to the id method to check if the current application identifier matches a given value. The method will return true if the identifier matches any of the given values:

Selectively Register Service Providers

Instead of adding all service providers to the config/app.php file, you may want to selectively register service providers for certain sub applications to optimize performance. To do so, simply list the providers to the providers array in the config/apps.php configuration file:

:warning: If your application runs on Laravel 5.5+ which support package discovery, you also need to disable discovery for the optional packages in the composer.json file:

Don't worry about the deferred service providers, as the deferred providers are only loaded when needed.

Define Application Routes

The routes method on the app manager helps you define route group for each application. In general, you will call it in the map method of your RouteServiceProvider:

The route files named with the application identifiers in the routes directory will be automatically loaded, such as routes/web.php, routes/admin.php.

By default, the routes method will assign the existing middleware group named with the application identifier or web to the route group, and the namespace applied to your controller routes will be StudlyCase of the application identifier.

For example, apps()->routes() is equivalent to:

Of course, you are free to specify any route attributes:

In addition to an array, you can pass a Closure to the routes method:

Generate URL

You can use the url method or the corresponding app_url helper function to generate an absolute URL to a path for a specified application:

The asset method generates a URL with the root URL of the assets application:

Custom Root URL For asset() Helper

The Laravel built-in URL::asset method or the corresponding asset, secure_asset helper functions are designed to generate URL for the application assets. In most applications, we will probably specify a cookie-free domain or use CDN for the assets, however we can not set custom root URL for these built-in assets methods, and for now there is no elegant way to extend the core UrlGenerator.

You may use URL::assetFrom, Apps::asset, or a custom helper function to generate assets URLs, but it is awfully boring to replace all asset() calls to your own assets method for the third-party packages. Maybe a better workaround is overwriting the built-in asset helper: define your asset function before including the Composer autoloader file, in your public/index.php file:

This package ships with an asset.php file you may include to use the root URL of the assets application for the asset() helper:

FYI, related PR laravel/framework#22372.

Extend Application Manager

The AppManager class is macroable, that means you can use the macro method to extend it:

Testing

License

This package is open-sourced software licensed under the MIT License.


All versions of laravel-apps with dependencies

PHP Build Version
Package Version
Requires php Version ~7.1|~8.0
illuminate/support Version ~5.0|~6.0|~7.0|~8.0|~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 elfsundae/laravel-apps contains the following files

Loading the files please wait ....