Download the PHP package mnabialek/laravel-quick-migrations without Composer

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

Laravel Quick Migrations

Build Status Coverage Status Scrutinizer Code Quality Packagist

This package is intended to improve speed of Laravel tests that needs to use migrations. In case you use Laravel's DatabaseMigrations trait (especially in Browser tests) you might be interested in using this package to save a lot of time.

Be aware this package doesn't improve speed of normal migrations you apply to database - it should be used only if have tests in your application and you want to improve their speed.

Installation

  1. Run

    in console to install this module (Notice --dev flag - it's recommended to use this package only for development).

  2. Run:

    and choose the number matching "Mnabialek\LaravelQuickMigrations\Providers\ServiceProvider" provider.

    By default you should not edit published file because all the settings are loaded from .env file by default.

    Depending on your needs you might add now into .env (or other env files used for tests):

    and customize it with your own values. Keep if mind if you set QUICK_MIGRATIONS_ENABLED you will automatically use default Laravel migrations again.

  3. Update all your tests where you use DatabaseMigrations trait with QuickDatabaseMigrations. You should add import line into those files too:

  4. Run:

    into empty database. Of course as selected_sql_connection you should use connection you really use in your app (usually mysql or mysql_testing).

    Now you can manually dump structure of this database into single file (or use mysqldump) and save file as storage/tests/dump.sql (If you set custom value of QUICK_MIGRATIONS_DUMP_FILE in your env file then you should of course put it into your custom location)

  5. Run your tests and enjoy!

Benchmarks

My test suite (real application) had 53 Laravel Dusk tests with 890 assertions running in Docker container. Database had 93 migrations.

Run DatabaseMigrations QuickDatabaseMigrations Difference
1st 24.7 min (28s/test) 8.29 min (9.4s/test) 16.41 min (2.98 times faster)
2nd 25.08 min (28.4s/test) 9.23 min (10.45s/test) 15.85 min (2.72 times faster)
3rd 24.37 min (27.57s/test) 7.92 min (8.97s/test) 16.45 min (3.08 times faster)

As you see in real-application scenario difference is quite impressive. Using modified trait makes tests running almost 3 times faster comparing to original tests.

Of course in your case results might be different. A lot of depends on migrations you have in your app - how long they take by default. For example assuming you have 100 tests using migrations and applying your migrations takes 10 seconds (for each test) and using your dump would take 6 seconds (for each test) then you would save 100 * 4 seconds that gives 6.66 minutes each time you are running your tests. As you see in my scenario difference was much bigger.

Cons

Authors

Author of this package is Marcin Nabiałek and Contributors

Changes

All changes are listed in Changelog

License

This package is licenced under the MIT license.


All versions of laravel-quick-migrations with dependencies

PHP Build Version
Package Version
Requires laravel/framework Version ^5.6|6.*|7.*|8.*|9.*|10.*|11.*
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 mnabialek/laravel-quick-migrations contains the following files

Loading the files please wait ....