Download the PHP package jhavenz/laravel-migration-table-parser without Composer

On this page you can find all versions of the php package jhavenz/laravel-migration-table-parser. 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-migration-table-parser

Laravel Migration Table Parser

Extracts the table name(s) from a Laravel migration with the assistance of the nikic/php-parser

Basic Usage

This package looks at the code used inside the up/down method of a migration file.

$result is a value object of type \Jhavenz\LaravelMigrationTableParser\ParserResult

$optionalTable is an instance of \Prewk\Option, a rust-inspired Some/None monad. Read more here

$tablesFoundCollection is an instance of \Illuminate\Support\Collection<string>

Dive into the /tests to learn more

Implementation Notes

You can run any other logic within your migration file(s), but the table name is extracted based on when you call one of these methods:

This package provides a couple extension points for you to implement your own logic.

Check out these interfaces:

Once implemented, you can pass your custom classes to the parser like so:

Note: When the parser runs, these implementations get resolved by the service container.

An alternative way to add your own logic is to add your implentation(s) to the config file: `

Installation

You can install the package via composer:

Publishing

You can publish the config file with:

This is the contents of the published config file:

Advanced Usage

The \Jhavenz\LaravelMigrationTableParser\ParserResult provides a handful of convenience methods to help you work with each result that's extracted from the migration file(s). It's basic makeup is:

Beyond the getters for the properties listed above, it has methods with the following signatures:

Lastly, the parser emits events that you can listen for.

Their basic makeup includes:

and

You can listen to these events using Laravel's event system, e.g.

Testing

Pest is used for testing and the initial commit for this repo is being pushed with ~30-40 tests.

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome.

Security Vulnerabilities

Please email me asap if you discover any security related issues:

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-migration-table-parser with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^10.0||^11.0
nikic/php-parser Version ^5.1
prewk/result Version ^4.0
spatie/laravel-package-tools Version ^1.16
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 jhavenz/laravel-migration-table-parser contains the following files

Loading the files please wait ....