This package extends the core file generators that are included with Laravel 5

Overview

Extended Migration Generators for Laravel 6, 7 and 8

Easily define the migration schema right in your make:migration command. The new commands this package provides are:

  • make:migration:schema
  • make:migration:pivot

Which allows you to do php artisan make:migration:schema create_dogs_table --schema="name:string:nullable, description:text, age:integer, email:string:unique" and get a full migration that you can run using php artisan migrate. For simple cases like this one, no need to tinker inside the migration file itself. And if you do need to change anything, it's easier because the bulk of the code has already been generated.

Created in 2015 by Jeffrey Way as a natural progression of his JeffreyWay/Laravel-4-Generators package, to provide the same features for Laravel 5. Since 2017 it's been maintained by the Backpack for Laravel team, with features and fixes added by community members like you. So feel free to pitch in.

https://user-images.githubusercontent.com/1032474/92732702-cd8b3700-f344-11ea-8e3b-ae86501d66fe.gif

Table of Contents

Versions

Depending on your Laravel version, you should:

Installation

You can install v2 of this project using composer, the service provider will be automatically loaded by Laravel itself:

composer require --dev laracasts/generators

You're all set. Run php artisan from the console, and you'll see the new commands in the make:* namespace section.

Examples

Migrations With Schema

php artisan make:migration:schema create_users_table --schema="username:string, email:string:unique"

Notice the format that we use, when declaring any applicable schema: a comma-separated list...

COLUMN_NAME:COLUMN_TYPE

So any of these will do:

username:string
body:text
age:integer
published_at:date
excerpt:text:nullable
email:string:unique:default('[email protected]')

Using the schema from earlier...

--schema="username:string, email:string:unique"

...this will give you:

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('users', function(Blueprint $table) {
			$table->increments('id');
			$table->string('username');
			$table->string('email')->unique();
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('users');
	}

}

When generating migrations with schema, the name of your migration (like, "create_users_table") matters. We use it to figure out what you're trying to accomplish. In this case, we began with the "create" keyword, which signals that we want to create a new table.

Alternatively, we can use the "remove" or "add" keywords, and the generated boilerplate will adapt, as needed. Let's create a migration to remove a column.

php artisan make:migration:schema remove_user_id_from_posts_table --schema="user_id:integer"

Now, notice that we're using the correct Schema methods.

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class RemoveUserIdFromPostsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::table('posts', function(Blueprint $table) {
			$table->dropColumn('user_id');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::table('posts', function(Blueprint $table) {
			$table->integer('user_id');
		});
	}

}

Here's a few other examples of commands that you might write:

  • php artisan make:migration:schema create_posts_table
  • php artisan make:migration:schema create_posts_table --schema="title:string, body:text, excerpt:string:nullable"
  • php artisan make:migration:schema remove_excerpt_from_posts_table --schema="excerpt:string:nullable"

Models

Now, when you create a migration, you typically want a model to go with it, right? By default, this package won't create a model to go with the migration. But it could. Just specify --model=true and it will do that for you:

php artisan make:migration:schema create_dogs_table --schema="name:string" --model=true

Migration Path

If you wish to specify a different path for your migration file, you can use the --path option like so:

php artisan make:migration:schema create_dogs_table --path=\database\migrations\pets

Foreign Constraints

There's also a secret bit of sugar for when you need to generate foreign constraints. Imagine that you have a posts table, where each post belongs to a user. Let's try:

php artisan make:migration:schema create_posts_table --schema="user_id:unsignedInteger:foreign, title:string, body:text"

Notice that "foreign" option (user_id:unsignedInteger:foreign)? That's special. It signals that user_id should receive a foreign constraint. Following conventions, this will give us:

$table->unsignedInteger('user_id');
$table->foreign('user_id')->references('id')->on('users');

As such, for that full command, our schema should look like so:

Schema::create('posts', function(Blueprint $table) {
	$table->increments('id');
	$table->unsignedInteger('user_id');
	$table->foreign('user_id')->references('id')->on('users');
	$table->string('title');
	$table->text('body');
	$table->timestamps();
);

Neato.

Pivot Tables

So you need a migration to setup a pivot table in your database? Easy. We can scaffold the whole class with a single command.

php artisan make:migration:pivot tags posts

Here we pass, in any order, the names of the two tables that we need a joining/pivot table for. This will give you:

<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePostTagPivotTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('post_tag', function(Blueprint $table) {
			$table->integer('post_id')->unsigned()->index();
			$table->foreign('post_id')->references('id')->on('posts')->onDelete('cascade');
			$table->integer('tag_id')->unsigned()->index();
			$table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('post_tag');
	}

}

Notice that the naming conventions are being followed here, regardless of what order you pass the table names.

Issues
  • Doesn't work with (yet-to-be-released) Laravel 5.4

    Doesn't work with (yet-to-be-released) Laravel 5.4

    PHP Fatal error:  Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found in /Users/Mike/Code/Laravel/moodeebee.com/vendor/laracasts/generators/src/Commands/MigrationMakeCommand.php on line 16
    
    [Symfony\Component\Debug\Exception\FatalErrorException]
      Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found
    

    I forked the repository and updated the namespace detector trait classname from AppNamespaceDetectorTrait to DetectsApplicationNamespace and although that surpasses the errors, the files that are generated don't have the correct class name.

    opened by mstnorris 31
  • Laravel 5.4 issue and asking for solution

    Laravel 5.4 issue and asking for solution

    Hello, I was using way/generators (it was awesome) with Laravel 4.2 without a problem. Now with a very basic installation of Laravel 5.4 I got this error while composer update:

    [email protected]:~/hoopss$ composer require laracasts/generators --dev Using version ^1.1 for laracasts/generators ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Nothing to install or update Generating autoload files Illuminate\Foundation\ComposerScripts::postUpdate php artisan optimize PHP Fatal error: Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found in /var/www/html/hoopss/vendor/laracasts/generators/src/Commands/MigrationMakeCommand.php on line 16

    [Symfony\Component\Debug\Exception\FatalErrorException]
    Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found

    Script php artisan optimize handling the post-update-cmd event returned with an error

    Installation failed, reverting ./composer.json to its original content.

    [RuntimeException]
    Error Output: PHP Fatal error: Trait 'Illuminate\Console\AppNamespaceDetectorTrait' not found in /var/www/html/hoopss/vendor/laracasts/generators/src/Commands/MigrationMakeCommand.php o
    n line 16

    require [--dev] [--prefer-source] [--prefer-dist] [--no-plugins] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] []...

    Can you please help?

    opened by ghost 27
  • make:seed curly class

    make:seed curly class

    While creating seed with make:seed this happens

    
    use Illuminate\Database\Seeder;
    
    // composer require laracasts/testdummy
    use Laracasts\TestDummy\Factory as TestDummy;
    
    class {{class}} extends Seeder//
    {
        public function run()
        {
            // TestDummy::times(20)->create('App\Post');
        }
    }
    

    adding {{class}} not substituting classname

    opened by arifmahmudrana 19
  • 2 migrations files are generated on  php artisan make:migration:schema.

    2 migrations files are generated on php artisan make:migration:schema.

    php artisan make:migration:schema create_companies_table - schema="user_id:integer:foreign:unsign
    ption:text,active:boolean,tax_no:varchar,child:boolean,child_of:integer:unsign"
    

    This command generate two files ,

    2015_05_13_084536_create_companies_table

    public function up()
    {
        Schema::create('companies', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->unsigned();
            $table->foreign('user_id')->references('id')->on('users');
            $table->string('title');
            $table->text('description');
            $table->boolean('active');
            $table->varchar('tax_no');
            $table->boolean('child');
            $table->intger('child_of')->unsign();
            $table->timestamps();
        });
    }
    

    2015_05_13_084537_create_companies_table

    public function up()
    {
        Schema::create('companies', function(Blueprint $table)
        {
            $table->increments('id');
            $table->timestamps();
        });
    }
    

    And in autoload class it register first migration file. 'CreateCompaniesTable' => $baseDir . '/database/migrations/2015_05_13_084536_create_companies_table.php',

    opened by ghost 17
  • (php artisan) Causes an Error in Laravel 5.2

    (php artisan) Causes an Error in Laravel 5.2

    Can anyone help, I am getting an error when I run php artisan

      [ReflectionException]                                
      Class Illuminate\Foundation\Composer does not exist 
    

    had to remove this line to get php artisan to work

        if ($this->app->environment() == 'local') {
            $this->app->register('Laracasts\Generators\GeneratorsServiceProvider');
        }
    
    opened by shawnsandy 12
  • Pivot migration generated with error

    Pivot migration generated with error

    • Laravel Version: 5.8
    • PHP Version: 7.3
    • Laravel-5-Generators-Extended Version:
    • Command: php artisan make:migration:pivot

    Description:

    Trying to run migration I got syntax error, unexpected '' (T_NS_SEPARATOR), expecting '{'

    my file looks like this:

    <?php
    
    use Illuminate\Database\Schema\Blueprint;
    use Illuminate\Database\Migrations\Migration;
    
    class App\ extends Migration
    {
        /**
         * Run the migrations.
         *
         * @return void
         */
        public function up()
        {
            Schema::create('kaciki_song', function (Blueprint $table) {
                $table->integer('kaciki_id')->unsigned()->index();
                $table->foreign('kaciki_id')->references('id')->on('kaciki')->onDelete('cascade');
                $table->integer('song_id')->unsigned()->index();
                $table->foreign('song_id')->references('id')->on('songs')->onDelete('cascade');
                $table->primary(['kaciki_id', 'song_id']);
            });
        }
    
        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down()
        {
            Schema::drop('kaciki_song');
        }
    }
    

    Steps To Reproduce:

    opened by Behinder 11
  • error when require the package

    error when require the package

    when i put this command

    composer require 'laracasts/generators' --dev

    i have this error

    [InvalidArgumentException] Could not find package 'laracasts/generators' at any version for your minimum-stability (stable). Check the package spelling or your minimum-stability

    what's the problem ? thank you

    opened by Rami-Sohail 10
  • Pivot doesn't substitute class name.

    Pivot doesn't substitute class name.

    Command:

    $ ./artisan make:migration:pivot somethings otherthings Migration created successfully.

    Generates:

    integer('otherthing_id')->unsigned()->index(); $table->foreign('otherthing_id')->references('id')->on('otherthings')->onDelete('cascade'); $table->integer('something_id')->unsigned()->index(); $table->foreign('something_id')->references('id')->on('somethings')->onDelete('cascade'); }); } ``` /** * Reverse the migrations. * * @return void */ public function down() { Schema::drop('otherthing_something'); } ``` }
    opened by nardev 10
  • Wrong generated pivot Class Name

    Wrong generated pivot Class Name

    Laravel version 5.2.41

    Laravel-5-Generators-Extended version 1.1.3

    run comand: php artisan make:migration:pivot pricelist_services pricelist_types

    Generated class name: CreatePricelist_periodPricelist_typePivotTable instead of CreatePricelistPeriodPricelistTypePivotTable

    opened by arturmamedov 8
  • fixed issue with array_map() expects parameter 1 to be a valid callback, class 'Str' not found in getSortedSingularTableNames

    fixed issue with array_map() expects parameter 1 to be a valid callback, class 'Str' not found in getSortedSingularTableNames

    fixed ErrorException : array_map() expects parameter 1 to be a valid callback, class 'Str' not found in PivotMigrationMakeCommand.php located at function getSortedSingularTableNames on line 171

    opened by YosefOberlander 3
  • Pivot Table creation results in error:  ErrorException  : array_map() expects parameter 1 to be a valid callback, class 'Str' not found

    Pivot Table creation results in error: ErrorException : array_map() expects parameter 1 to be a valid callback, class 'Str' not found

    • Laravel Version: 6.20.26
    • PHP Version: 7.3.21
    • Laravel-5-Generators-Extended Version: 2.0
    • Command: php artisan make:migration:pivot departments users

    What I did

    run the command and add 2 table names

    What I expected to happen

    I expect the command to generate the pivot table

    What happened

    it resulted in the following error:

    
       ErrorException  : array_map() expects parameter 1 to be a valid callback, class 'Str' not found
    
      at D:\XXXXX\API\vendor\laracasts\generators\src\Commands\PivotMigrationMakeCommand.php:173
        169|      * @return array
        170|      */
        171|     protected function getSortedSingularTableNames()
        172|     {
      > 173|         $tables = array_map('Str::singular', $this->getTableNamesFromInput());
        174| 
        175|         sort($tables);
        176| 
        177|         return $tables;
    
      Exception trace:
    
      1   array_map("Str::singular")
          D:\XXXXX\API\vendor\laracasts\generators\src\Commands\PivotMigrationMakeCommand.php:173
    
      2   Laracasts\Generators\Commands\PivotMigrationMakeCommand::getSortedSingularTableNames()
          D:\XXXXX\API\vendor\laracasts\generators\src\Commands\PivotMigrationMakeCommand.php:150
    
      Please use the argument -v to see more details.
    

    What I've already tried to fix it

    I tried some debugging, but I didn't succeed...

    opened by JustinRijsdijk 2
  • I couldn't install this package with Laravel 5.8.*

    I couldn't install this package with Laravel 5.8.*

    • Laravel Version: #.#.#
    • PHP Version:
    • Laravel-5-Generators-Extended Version:
    • Command:

    What I did

    composer require --dev laracasts/generators Using version ^2.0 for laracasts/generators ./composer.json has been updated Loading composer repositories with package information Updating dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages.

    Problem 1 - Installation request for laracasts/generators ^2.0 -> satisfiable by laracasts/generators[2.0.0]. - Conclusion: remove laravel/framework v5.8.38 - Conclusion: don't install laravel/framework v5.8.38 - laracasts/generators 2.0.0 requires illuminate/support ~6.0|~7.0|~8.0 -> satisfiable by illuminate/support[6.x-dev, 7.x-dev, 8.x-dev, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1 .0, v6.10.0, v6.11.0, v6.12.0, v6.13.0, v6.13.1, v6.14.0, v6.15.0, v6.15.1, v6.16.0, v6.17.0, v6.17.1, v6.18.0, v6.18.1, v6.18.10, v6.18.11, v6.18.12, v6.18.13, v6.18.14, v6.18.15, v6. 18.16, v6.18.17, v6.18.18, v6.18.19, v6.18.2, v6.18.20, v6.18.21, v6.18.22, v6.18.23, v6.18.24, v6.18.25, v6.18.26, v6.18.27, v6.18.28, v6.18.29, v6.18.3, v6.18.30, v6.18.31, v6.18.32, v6.18.33, v6.18.34, v6.18.35, v6.18.36, v6.18.37, v6.18.38, v6.18.39, v6.18.4, v6.18.40, v6.18.41, v6.18.42, v6.18.43, v6.18.5, v6.18.6, v6.18.7, v6.18.8, v6.18.9, v6.19.0, v6.19.1, v 6.2.0, v6.20.0, v6.20.1, v6.20.2, v6.20.3, v6.20.4, v6.20.5, v6.3.0, v6.4.1, v6.5.0, v6.5.1, v6.5.2, v6.6.0, v6.6.1, v6.6.2, v6.7.0, v6.8.0, v7.0.0, v7.0.1, v7.0.2, v7.0.3, v7.0.4, v7. 0.5, v7.0.6, v7.0.7, v7.0.8, v7.1.0, v7.1.1, v7.1.2, v7.1.3, v7.10.0, v7.10.1, v7.10.2, v7.10.3, v7.11.0, v7.12.0, v7.13.0, v7.14.0, v7.14.1, v7.15.0, v7.16.0, v7.16.1, v7.17.0, v7.17. 1, v7.17.2, v7.18.0, v7.19.0, v7.19.1, v7.2.0, v7.2.1, v7.2.2, v7.20.0, v7.21.0, v7.22.0, v7.22.1, v7.22.2, v7.22.3, v7.22.4, v7.23.0, v7.23.1, v7.23.2, v7.24.0, v7.25.0, v7.26.0, v7.2 6.1, v7.27.0, v7.28.0, v7.28.1, v7.28.2, v7.28.3, v7.28.4, v7.29.0, v7.29.1, v7.29.2, v7.29.3, v7.3.0, v7.4.0, v7.5.0, v7.5.1, v7.5.2, v7.6.0, v7.6.1, v7.6.2, v7.7.0, v7.7.1, v7.8.0, v 7.8.1, v7.9.0, v7.9.1, v7.9.2, v8.0.0, v8.0.1, v8.0.2, v8.0.3, v8.0.4, v8.1.0, v8.10.0, v8.11.0, v8.11.1, v8.11.2, v8.12.0, v8.12.1, v8.12.2, v8.12.3, v8.13.0, v8.14.0, v8.15.0, v8.16. 0, v8.16.1, v8.2.0, v8.3.0, v8.4.0, v8.5.0, v8.6.0, v8.7.0, v8.7.1, v8.8.0, v8.9.0]. - don't install illuminate/support 6.x-dev|don't install laravel/framework v5.8.38 - don't install illuminate/support 7.x-dev|don't install laravel/framework v5.8.38 - don't install illuminate/support 8.x-dev|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.0.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.0.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.0.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.0.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.0.4|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.1.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.10.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.11.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.12.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.13.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.13.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.14.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.15.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.15.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.16.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.17.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.17.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.10|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.11|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.12|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.13|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.14|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.15|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.16|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.17|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.18|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.19|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.20|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.21|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.22|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.23|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.24|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.25|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.26|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.27|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.28|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.29|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.30|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.31|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.32|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.33|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.34|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.35|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.36|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.37|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.38|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.39|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.4|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.40|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.41|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.42|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.43|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.5|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.6|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.7|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.8|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.18.9|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.19.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.19.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.2.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.20.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.20.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.20.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.20.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.20.4|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.20.5|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.3.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.4.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.5.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.5.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.5.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.6.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.6.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.6.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.7.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v6.8.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.4|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.5|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.6|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.7|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.0.8|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.1.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.1.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.1.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.1.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.10.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.10.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.10.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.10.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.11.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.12.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.13.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.14.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.14.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.15.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.16.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.16.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.17.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.17.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.17.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.18.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.19.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.19.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.2.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.2.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.2.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.20.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.21.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.22.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.22.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.22.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.22.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.22.4|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.23.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.23.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.23.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.24.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.25.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.26.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.26.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.27.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.28.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.28.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.28.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.28.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.28.4|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.29.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.29.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.29.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.29.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.3.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.4.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.5.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.5.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.5.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.6.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.6.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.6.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.7.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.7.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.8.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.8.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.9.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.9.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v7.9.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.0.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.0.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.0.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.0.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.0.4|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.1.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.10.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.11.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.11.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.11.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.12.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.12.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.12.2|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.12.3|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.13.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.14.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.15.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.16.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.16.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.2.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.3.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.4.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.5.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.6.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.7.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.7.1|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.8.0|don't install laravel/framework v5.8.38 - don't install illuminate/support v8.9.0|don't install laravel/framework v5.8.38 - Installation request for laravel/framework (locked at v5.8.38, required as ^5.8.0) -> satisfiable by laravel/framework[v5.8.38].

    Installation failed, reverting ./composer.json to its original content.

    What I expected to happen

    ??

    What happened

    ??

    What I've already tried to fix it

    ??

    opened by vjain1994 1
  • create empty pivot table

    create empty pivot table

    • Laravel Version: 5.8.13
    • PHP Version: 7.1.3
    • Laravel-5-Generators-Extended Version:
    • Command: php artisan make:migration:pivot cities suppliers

    What I did

    I am trying to run php artisan make:migration:pivot cities suppliers

    What happened

    ya sure it created the migration witch looks like this 2020_08_27_030342_create__pivot_table.php and inside the migration file all the fields empty something like this

    Schema::create('', function (Blueprint $table) {
                $table->integer('_id')->unsigned()->index();
                $table->foreign('_id')->references('id')->on('')->onDelete('cascade');
                $table->integer('_id')->unsigned()->index();
                $table->foreign('_id')->references('id')->on('')->onDelete('cascade');
                $table->primary(['_id', '_id']);
            });
    
    opened by johnef 0
  • Improve foreign key generator based on Laravel 7

    Improve foreign key generator based on Laravel 7

    • Laravel Version: 7.2.4
    • PHP Version: 7.4
    • Laravel-5-Generators-Extended Version: 1.1
    • Command: php artisan make:migration:pivot

    In Laravel 7, isn't it better to write this line: $table->foreignId('tableOne_id')->constrained()->onDelete('cascade');

    instead of these lines:

    $table->integer('tableOne_id')->unsigned()->index();
    $table->foreign('tableOne_id')->references('id')->on('tableOnes')->onDelete('cascade');
    

    ?

    opened by amirmojiry 0
  • "php artisan make:migration:pivot" didn't add "use Illuminate\Support\Facades\Schema;" automatically

    • Laravel Version: 7.2.4
    • PHP Version: 7.4
    • Laravel-5-Generators-Extended Version: 1.1
    • Command: php artisan make:migration:pivot tableOne tableTwo

    What I did

    I executed this command: php artisan make:migration:pivot tableOne tableTwo

    What I expected to happen and what happened

    I expected this line, automatically add to above of migration file:

    use Illuminate\Support\Facades\Schema;

    However this didn't happen.

    opened by amirmojiry 1
  • Generated models should include proper relationships

    Generated models should include proper relationships

    help wanted Priority: SHOULD 
    opened by tabacitu 0
  • default to generating models in app\Models

    default to generating models in app\Models

    Priority: COULD 
    opened by tabacitu 1
Releases(1.2.0)
⚙️ A Laravel package to decompose your installed packages, their dependencies, your app & server environment

Introduction Laravel Decomposer decomposes and lists all the installed packages and their dependencies along with the Laravel & the Server environment

LUBUS 501 Oct 12, 2021
A cli tool for creating Laravel packages

Laravel Packager This package provides you with a simple tool to set up a new package and it will let you focus on the development of the package inst

JeroenG 1.1k Oct 18, 2021
Creates an 'artisan workflow:make' command to scaffold out a number of useful GitHub actions workflows for Laravel

Laravel workflow generator This creates a make:workflow artisan command to scaffold out a number of useful GitHub actions workflows for Laravel. Insta

Len Woodward 9 Jul 18, 2021
Generate migrations from existing database structures

Laravel Migration Generator Generate migrations from existing database structures, an alternative to the schema dump provided by Laravel. A primary us

Bennett Treptow 240 Oct 22, 2021
Laravel API Documentation Generator

Laravel API Documentation Generator Automatically generate your API documentation from your existing Laravel/Lumen/Dingo routes. php artisan apidoc:ge

Marcel Pociot 3.1k Oct 15, 2021
⛔️ Laravel Tinx is archived and no longer maintained.

⛔️ Laravel Tinx (Deprecated) Laravel Tinx was archived on 12th December 2019 and is no longer maintained. Looking for a reloadable version of Laravel

James Furey 432 Oct 15, 2021
A code generator for EasySwoole

wise-generator-easyswoole 基于EasySwoole的code-generation改写,主要应用与内部系统。基本上所有类都有所调整,同时也完善了一些功能。 版本说明 版本说明 code-generation 使用命令行,一键生成业务通用代码,支持代码如下: 一键生成项目初始

Ryan 3 Jun 8, 2021
InfyOm Laravel Generator - API, Scaffold, Tests, CRUD Laravel Generator

InfyOm Laravel Generator Generate Admin Panels CRUDs and APIs in Minutes with tons of other features and customizations with 3 different themes. Read

InfyOmLabs (InfyOm Technologies) 3.3k Oct 13, 2021
[Package] Lumen Testing Helper for Packages Development

anik/testbench-lumen is a package, highly inspired by the orchestral/testbench. orchestral/testbench that is a tool for testing Laravel packages.

Syed Sirajul Islam Anik 5 May 9, 2021
:rocket: A Smart CRUD Generator For Laravel

Features Generate your models, views, controllers, routes and migrations just in a few clicks. Models visualization through a graph presentation (New

Houssain Amrani 860 Oct 21, 2021
🍪 Write gorgeous documentation for your products using Markdown inside your Laravel app.

LaRecipe Write gorgeous documentations for your products using Markdown inside your Laravel app. LaRecipe ?? LaRecipe is simply a code-driven package

Saleem Hadad 1.9k Oct 17, 2021
ICEcoder is a browser based code editor, which provides a modern approach to building websites

ICEcoder Code editor awesomeness ...in your browser ICEcoder is a browser based code editor, which provides a modern approach to building websites. By

ICEcoder 1.3k Oct 5, 2021
A MySQL Workbench plugin which exports a Model to Laravel 5 Migrations

MySQL Workbench Export Laravel 5 Migrations Plugin A MySQL Workbench plugin that allows for exporting a model to Laravel 5 migrations that follow PSR-

Brandon Eckenrode 889 Oct 16, 2021
Prequel for Laravel. Clear and concise database management.

TL;DR? Test Prequel here! What is Prequel exactly? Prequel is meant to be a database management tool for Laravel to replace the need for separate stan

Protoqol 1.3k Oct 17, 2021
Module Generator Composer Package For Laravel

Module Generator Installation You can install the package via composer: composer require teacoders/module-generator Run the command below to publish t

Tea Coders 20 Sep 6, 2021
Open Swoole IDE Helper

Open Swoole IDE Helper This repo works with Open Swoole since release version v4.7.1. This package contains IDE help files for OpenSwoole. You may use

Open Swoole 1 Oct 17, 2021
A PHP README File Generator, to generate easily your GitHub README files 🎉

Readme Generator ?? Requiremennts ?? Make sure you have PHP 8.0 or higher installed. Steup ⚙️ Install Composer v2 or higher (https://getcomposer.org)

♚ PH⑦ de Soria™♛ 2 Oct 24, 2021
A PHP webpage that uses string replacements to generate a binary on the fly that you can enter at setup in NEOS.

openpilot-installer-generator A PHP webpage that uses string replacements to generate a binary on the fly that you can enter at setup in NEOS. What is

null 14 Sep 25, 2021
A PHP-based sandboxing library with a full suite of configuration and validation options.

A full-scale PHP 5.4+ sandbox class that utilizes PHP-Parser to prevent sandboxed code from running unsafe code. It also utilizes FunctionParser to di

Corveda 165 Oct 15, 2021