Download the PHP package diego-rlima/artisan-make-file-location without Composer

On this page you can find all versions of the php package diego-rlima/artisan-make-file-location. 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 artisan-make-file-location

diego-rlima/artisan-make-file-location

Ability to change the namespace/location of the files generated by the "artisan make" commands.

Requirements

This package requires Laravel 5.4 or later and PHP 7.1.0 or later.

Installation

For Laravel 5.4, you must register the service provider of this package. Add the code below in the providers section of your config/app.php file.

Using

You can use all "artisan make" commands as usual. But now, you can add the options --prefix and --suffix to change the namespace of your files.

Note: For files that do not have namespace (like migrations), only the prefix can be used.

Prefix

This will output the file with the namespace App\Units\Products\Controllers.

Suffix

This will output the file with the namespace App\Http\Controllers\Products.

Both Prefix and Suffix

This will output the file with the namespace App\Units\Controllers\Products.

Customizing

The package is configured to be compatible with the Laravel standard, but allowing you to set prefixes and suffixes. However, you can replace the Laravel pattern with your own.

Publish the config using the following command:

Now you have a config/amfl.php file. The settings are divided between files that have namespaces and files that they do not have.

For files with namespace, the {root} normally will be replaced by the "App" namespace. Of curse, {prefix} and {suffix} will be replaced by the prefix and suffix you choose.

In the test files, {root} will be changed to "Tests" namespace. These files also have namespace variation. The {type} will be changed to "Unit" or "Feature".

For files without namespace, the {root} will be replaced by the root directory of application. The {prefix} and {name} will be replaced by the prefix and the file name, respectively.

Important: If you are going to create the migrations in another folder, make sure the folder is already created, or the migration will not be created. This is due to the way the original command was written.

Making prefixes/suffixes required

All you have to do is add |required to the file configuration. Eg.:

Defining a default value for prefixes/suffixes

Just add |default:YouDefaultValue to the file configuration. Eg.:

Note: Default values will not be applied if prefix/suffix is required.

Extending other commands

Do you want to use prefixes / suffixes in your commands or third-party commands? Just do it!

Let's assume that your command class looks like the following:

You need to change the class so that it can retrieve the pattern we set. It will be similar to:

If your command will generate a file without namespace, the code must change a bit. It should look like:

In your AppServiceProvider, extend the list of commands.

Put the pattern configuration of the command inside your "config/amfl.php" file.

List of commands supported

Command Supports prefix Supports suffix Min. Laravel Version
make:channel yes yes 5.6
make:command yes yes 5.4
make:controller yes yes 5.4
make:event yes yes 5.4
make:exception yes yes 5.6
make:factory yes no 5.6
make:job yes yes 5.4
make:listener yes yes 5.4
make:mail yes yes 5.4
make:middleware yes yes 5.4
make:migration yes no 5.4
make:model yes no 5.4
make:notification yes yes 5.4
make:policy yes yes 5.4
make:provider yes yes 5.4
make:request yes yes 5.4
make:resource yes yes 5.6
make:rule yes yes 5.6
make:seeder yes no 5.4
make:test yes yes 5.4

All versions of artisan-make-file-location with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
laravel/framework Version >=5.4
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 diego-rlima/artisan-make-file-location contains the following files

Loading the files please wait ....