readerstacks/migrateexcel

There is no license information available for the latest version (1.2) of this package.

Migrate laravel excel 2 to 3 withour much headache

1.2 2022-03-08 10:42 UTC

This package is auto-updated.

Last update: 2024-05-08 15:32:42 UTC


README

68747470733a2f2f69302e77702e636f6d2f726561646572737461636b732e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032312f31302f53637265656e73686f745f323032312d31302d33305f61745f31312e32312e33335f414d2d72656d6f766562672d707265766965772d352d312e706e673f773d3530302673736c3d31

Laravel Excel(maatwebsite/excel) 2 and 3 Bridge


Laravel Query Migration is a tool to migrate raw query in migration and keep track of them accross the servers.

For license information check the LICENSE-file.

Features

  • Use methods of Laravel Excel 2 methods in Excel maatwebsite/excel 3

Installation

1 - Dependency

The first step is using composer to install the package and automatically update your composer.json file, you can do this by running:

composer require readerstacks/migrateexcel

Note: If you are using Laravel 5.5, the steps 2 for providers and aliases, are unnecessaries. QieryMigrations supports Laravel new Package Discovery.

2 - Provider

You need to update your application configuration in order to register the package so it can be loaded by Laravel, just update your config/app.php file adding the following code at the end of your 'providers' section:

config/app.php

<?php

return [
    // ...
    'providers' => [
        Readerstacks\MigrateExcel\MigrateExcelServiceProvider::class,
        // ...
    ],
    // ...
];

Lumen

Go to /bootstrap/app.php file and add this line:

<?php
// ...

$app = new Laravel\Lumen\Application(
    dirname(__DIR__)
);

// ...

$app->register(Readerstacks\MigrateExcel\MigrateExcelServiceProvider::class);

// ...

return $app;

3 Configuration

Publish config

In your terminal type

php artisan vendor:publish --provider="Readerstacks\MigrateExcel\MigrateExcelServiceProvider"

Run Migration

In your terminal type

php artisan QueryMigrate

Usage

Laravel Usage

Add Query

php artisan QueryMigrate add --run

This will ask to enter the query to update the migration file and also run the query in database

If you want to update the migration and not wanted to run in database then remove --run option as below

php artisan QueryMigrate add 

Check pending migrations

In your terminal type

php artisan QueryMigrate pending

Run migrations

In your terminal type

php artisan QueryMigrate migrate

Run single migration only

In your terminal type

php artisan QueryMigrate migrate --uid=uid_of_migration 

Run single migration again

In your terminal type

php artisan QueryMigrate migrate --uid=uid_of_migration  --f