A collection of generators for Lumen and Laravel 5.

Overview

Lumen generators

Build Status Scrutinizer Code Quality SensioLabsInsight License

A collection of generators for Lumen and Laravel 5.

Contents

Why ?

I installed Lumen and wanted to use it to create a REST API (since this is the main usage of Lumen). But I didn't find commands which will speed up my workflow. That's why I created this package and included useful commands to build a RESTful API.

This packages was mainly built to be used with Lumen, but it should work fine with Laravel 5 too.

Installation

Add the generators package to your composer.json by running the command:

composer require wn/lumen-generators

Then add the service provider in the file app/Providers/AppServiceProvider.phplike the following:

public function register()
{
    if ($this->app->environment() == 'local') {
        $this->app->register('Wn\Generators\CommandsServiceProvider');
    }
}

Don't forget to include the application service provider on your bootstrap/app.php and to enable Eloquent and Facades if you are using Lumen

If you run the command php artisan list you will see the list of added commands:

wn:controller               Generates RESTful controller using the RESTActions trait
wn:controller:rest-actions  Generates REST actions trait to use into controllers
wn:migration                Generates a migration to create a table with schema
wn:model                    Generates a model class for a RESTfull resource
wn:pivot-table              Generates creation migration for a pivot table
wn:resource                 Generates a model, migration, controller and routes for RESTful resource
wn:resources                Generates multiple resources from a file
wn:route                    Generates RESTful routes.

Quick Usage

To generate a RESTful resource for your application (model, migration, controller and RESTful routes), you simply need to run one single command. For example:

php artisan wn:resource task "name;string;required;fillable project_id;integer:unsigned;numeric;fillable,key due;date;;date" --add=timestamps --belongs-to=project

will generate these files:

app/Task.php

"required", "project_id" => "numeric", ]; public function project() { return $this->belongsTo("App\Project"); } } ">
 namespace App;

use Illuminate\Database\Eloquent\Model;

class Task extends Model {

	protected $fillable = ["name", "project_id"];

	protected $dates = ["due"];

	public static $rules = [
		"name" => "required",
		"project_id" => "numeric",
	];

	public function project()
	{
		return $this->belongsTo("App\Project");
	}

}

app/Http/Controllers/RESTActions.php

 namespace App\Http\Controllers;

use Illuminate\Http\Request;


trait RESTActions {

	protected $statusCodes = [
		'done' => 200,
		'created' => 201,
		'removed' => 204,
		'not_valid' => 400,
		'not_found' => 404,
		'conflict' => 409,
		'permissions' => 401
	];

	public function all()
	{
		$m = self::MODEL;
		return $this->respond('done', $m::all());
	}

	public function get($id)
	{
		$m = self::MODEL;
		$model = $m::find($id);
		if(is_null($model)){
			return $this->respond('not_found');
		}
		return $this->respond('done', $model);
	}

	public function add(Request $request)
	{
		$m = self::MODEL;
		$this->validate($request, $m::$rules);
		return $this->respond('created', $m::create($request->all()));
	}

	public function put(Request $request, $id)
	{
		$m = self::MODEL;
		$this->validate($request, $m::$rules);
		$model = $m::find($id);
		if(is_null($model)){
			return $this->respond('not_found');
		}
		$model->update($request->all());
		return $this->respond('done', $model);
	}

	public function remove($id)
	{
		$m = self::MODEL;
		if(is_null($m::find($id))){
			return $this->respond('not_found');
		}
		$m::destroy($id);
		return $this->respond('removed');
	}

    protected function respond($status, $data = [])
    {
    	return response()->json($data, $this->statusCodes[$status]);
    }

}

app/Http/Controllers/TasksController.php

 namespace App\Http\Controllers;


class TasksController extends Controller {

	const MODEL = "App\Task";

	use RESTActions;

}

app/Http/routes.php

// These lignes will be added
/**
 * Routes for resource task
 */
$app->get('task', 'TasksController@all');
$app->get('task/{id}', 'TasksController@get');
$app->post('task', 'TasksController@add');
$app->put('task/{id}', 'TasksController@put');
$app->delete('task/{id}', 'TasksController@remove');

database/migrations/date_time_create_tasks.php



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

class CreateTasksMigration extends Migration
{
    
    public function up()
    {
        Schema::create('tasks', function(Blueprint $table) {
            $table->increments('id');
            $table->string('name');
            $table->integer('project_id')->unsigned();
            $table->date('due');
            $table->foreign('project_id')
                ->references('id')
                ->on('projects');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('tasks');
    }
}

Now simply run the migration and you are ready to go.

More then that, you can generate multiple resources with only one command ! Click here to see an example

Detailed Usage

Model Generator

The wn:model command is used to generate a model class based on Eloquent. It has the following syntax:

wn:model name [--fillable=...] [--dates=...] [--has-many=...] [--has-one=...] [--belongs-to=...] [--belongs-to-many=...] [--rules=...] [--timestamps=false] [--path=...] [--soft-deletes=true] [--force=true]
  • name: the name of the model.

php artisan wn:model Task generates the following:

 namespace App;

use Illuminate\Database\Eloquent\Model;

class Task extends Model {

	protected $fillable = [];

	protected $dates = [];

	public static $rules = [
		// Validation rules
	];

	// Relationships

}
  • --fillable: the mass fillable fields of the model separated with commas.

php artisan wn:model Task --fillable=name,title gives:

//...	
	protected $fillable = ['name', 'title'];
  • --dates: the date fields of the model, these will be converted automatically to Carbon instances on retrieval.

php artisan wn:model Task --dates=started_at,published_at gives:

//...	
	protected $dates = ['started_at', 'published_at'];
  • --path: specifies the path where to store the model php file. This path is used to know the namespace of the model. The default value is "app".

php artisan wn:model Task --path="app/Http/Models" gives:

 namespace App\Http\Models;
//...
  • --has-one, --has-many, --belongs-to and --belongs-to-many: the relationships of the model following the syntax relation1:model1,relation2:model2,.... If the model is missing, it will be deducted from the relation's name. If the model is given without a namespace, it will be considered having the same namespace as the model being generated.
php artisan wn:model Task --has-many=accounts --belongs-to="owner:App\User" --has-one=number:Phone belongs-to-many=tags --path=tests/tmp

gives:

belongsTo("App\User"); } public function number() { return $this->hasOne("Tests\Tmp\Phone"); } public function tags() { return $this->belongsToMany("Tests\Tmp\Tag")->withTimestamps(); } ">
//...
	public function accounts()
	{
		return $this->hasMany("Tests\Tmp\Account");
	}

	public function owner()
	{
		return $this->belongsTo("App\User");
	}

	public function number()
	{
		return $this->hasOne("Tests\Tmp\Phone");
	}

	public function tags()
	{
		return $this->belongsToMany("Tests\Tmp\Tag")->withTimestamps();
	}
  • --rules: specifies the validation rules of the model's fields. The syntax is field1=rules1 field2=rules2 ....
php artisan wn:model TestingModel --rules="name=required age=integer|min:13 email=email|unique:users,email_address"`

gives:

"required", "age" => "integer|min:13", "email" => "email|unique:users,email_address", ]; ">
// ...
	public static $rules = [
		"name" => "required",
		"age" => "integer|min:13",
		"email" => "email|unique:users,email_address",
	];
  • --timestamps: Enables timestamps on the model. Giving --timestamps=false will add public $timestamps = false; to the generated model. The default value is true.

  • --soft-deletes: Adds Illuminate\Database\Eloquent\SoftDeletes trait to the model. This is disabled by default.

  • --force: tells the generator to override the existing file. By default, if the model file already exists, it will not be overriden and the output will be something like:

TestingModel model already exists; use --force option to override it !

Migration Generator

The wn:migration command is used to generate a migration to create a table with schema. It has the following syntax:

wn:migration table [--schema=...] [--add=...] [--keys=...] [--force=true] [--file=...]
  • table: the name of the table to create.

  • --file: The migration file name (to speicify only for testing purpose). By default the name follows the patern date_time_create_tableName_table.php.

  • --schema: the schema of the table using the syntax field1:type.arg1,ag2:modifier1:modifier2.. field2:.... The type could be text, string.50, decimal.5,2 for example. Modifiers can be unique or nullable for example. See documentation for the list of available types and modifiers.

php artisan wn:migration tasks --schema="amount:decimal.5,2:after.'size':default.8 title:string:nullable"

gives:



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

class CreateTasksMigration extends Migration
{
    
    public function up()
    {
        Schema::create('tasks', function(Blueprint $table) {
            $table->increments('id');
            $table->decimal('amount', 5, 2)->after('size')->default(8);
            $table->string('title')->nullable();
            // Constraints declaration

        });
    }

    public function down()
    {
        Schema::drop('tasks');
    }
}
  • --add: Specifies additional columns like timestamps, softDeletes, rememberToken and nullableTimestamps.

  • --keys: the foreign keys of the table following the syntax field:column:table:on_delete:on_update .... The column is optional ("id" by default). The table is optional if the field follows the naming convention singular_table_name_id. on_delete and on_update are optional too.

php artisan wn:migration tasks --keys="category_type_id user_id:identifier:members:cascade"

gives:

//...
$table->foreign('category_type_id')
    ->references('id')
    ->on('category_types');

$table->foreign('user_id')
    ->references('identifier')
    ->on('members')
    ->onDelete('cascade');

Pivot Table Generator

The wn:pivot-table command is used to generate a migration to create a pivot table between two models. It has the following syntax:

wn:pivot-table model1 model2 [--add=...] [--force=true] [--file=...]
  • model1 and model2: names of the two models (or the two tables if the models don't follow the naming conventions)

  • --add: Specifies additional columns like timestamps, softDeletes, rememberToken and nullableTimestamps.

  • --file: The migration file name. By default the name follows the patern date_time_create_table_name.php.

php artisan wn:pivot-table Tag Project --add=timestamps

gives:



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

class CreateProjectTagMigration extends Migration
{
    
    public function up()
    {
        Schema::create('project_tag', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('project_id')->unsigned()->index();
            $table->integer('tag_id')->unsigned()->index();
            $table->foreign('project_id')
                ->references('id')
                ->on('projects');
            $table->foreign('tag_id')
                ->references('id')
                ->on('tags');
            $table->timestamps();
        });
    }

    public function down()
    {
        Schema::drop('project_tag');
    }
}

Controller Generator

There are two commands for controllers. The first one is wn:controller:rest-actions which generates a trait used by all generated controllers. This trait includes the following methods:

  • all() : returns all the model entries as JSON.

  • get($id) : returns a specific model by id as JSON.

  • add(Request $request) : adds a new model or returns validation errors as JSON.

  • put(Request $request, $id) : updates a model or returns validation errors as JSON.

  • remove($id) : removes an entry by id.

Note that the trait doesn't use the common used methods on Laravel (like index, store, ...) to avoid conflicts. Which enables you to use this trait with controllers you already have in your application.

The second command is wn:controller which actually generates the controller. The syntax of this command is wn:controller model [--no-routes] [--force=true].

  • model: Name of the model (with namespace if not App).

  • --no-routes: Since routes are generated by default for the controller, this option is used to tell the generator "do not generate routes !".

  • --force: tells the generator to override the existing file.

  • --laravel: create Laravel style routes

php artisan wn:controller Task --no-routes gives:

 namespace App\Http\Controllers;


class TasksController extends Controller {

	const MODEL = "App\\Task";

	use RESTActions;

}

Routes Generator

The wn:route command is used to generate RESTfull routes for a controller. It has the following syntax:

wn:route resource [--controller=...] [--force=true]

  • resource: the resource name to use in the URLs.

  • --controller: the corresponding controller. If missing it's deducted from the resource name.

  • --force: tells the generator to override the existing file.

  • --laravel: create Laravel style routes

php artisan wn:route project-type adds the following routes:

$app->get('project-type', 'ProjectTypesController@all');
$app->get('project-type/{id}', 'ProjectTypesController@get');
$app->post('project-type', 'ProjectTypesController@add');
$app->put('project-type/{id}', 'ProjectTypesController@put');
$app->delete('project-type/{id}', 'ProjectTypesController@remove');

php artisan wn:route project-type --laravel adds the following routes:

Route::get('project-type', 'ProjectTypesController@all');
Route::get('project-type/{id}', 'ProjectTypesController@get');
Route::post('project-type', 'ProjectTypesController@add');
Route::put('project-type/{id}', 'ProjectTypesController@put');
Route::delete('project-type/{id}', 'ProjectTypesController@remove');

Resource Generator

The wn:resource command makes it very easy to generate a RESTful resource. It generates a model, migration, controller and routes. The syntax is : wn:resource name fields [--add=...] [--has-many=...] [--has-one=...] [--belongs-to=...] [--migration-file=...] [--path=...] [--force=true]

  • name: the name of the resource used in the URLs and to determine the model, table and controller names.

  • fields: specifies the fields of the resource along with schema and validation rules. It follows the syntax name;schema;rules;tags ...

    • name: the name of the field

    • schema: the schema following the syntax in the model generator. (note that the name is not part of the schema like on the model generator)

    • rules: the validation rules

    • tags: additional tags separated by commas. The possible tags are:

      • fillable: add this field to the fillable array of the model.

      • date: add this field to the dates array of the model.

      • key: this field is a foreign key.

  • --add: Specifies additional columns like timestamps, softDeletes, rememberToken and nullableTimestamps of the migration and if the list contains no timestamps, the model with contain public $timestamps = false;.

  • --has-one, --has-many and --belongs-to are the same as for the wn:model command.

  • --migration-file: passed to the wn:migration as the --file option.

  • --path: Defines where to store the model file as well as its namespace.

  • --force: tells the generator to override the existing file.

  • --laravel: create Laravel style routes

Multiple Resources From File

The wn:resources (note the "s" in "resources") command takes the generation process to an other level by parsing a file and generating multiple resources based on it. The syntax is

wn:resources filename [--path=...] [--force=true]

This generator is smart enough to add foreign keys automatically when finding a belongsTo relation. It also generates pivot tables for belongsToMany relations automatically.

The file given to the command should be a valid YAML file ( for the moment, support of other types like XML or JSON could be added in the future). An example is the following:

  • --path: Defines where to store the model files as well as their namespace.

  • --laravel: create Laravel style routes

---
Store:
  hasMany: products
  fields:
    name:
      schema: string:50 unique
      rules: required|min:3
      tags: fillable
Product:
  belongsTo: store
  fields:
    name:
      schema: string
      rules: required
      tags: fillable
    store_id:
      schema: integer unsigned
      rules: required numeric
      tags: fillable key
    desc:
      schema: text nullable
      tags: fillable
    published_at:
      schema: date
      rules: date
      tags: date fillable
    price:
      schema: 'decimal:5,2' # need quotes when using ','
      rules: numeric
      tags: fillable
  add: timestamps softDeletes

Testing

To test the generators, I included a fresh lumen installation under the folder lumen-test to which I added this package and have written some acceptance tests using Codeception. To run tests you just have to execute the install.sh to install dependencies then execute test.sh.

Development Notes

Contributing

Pull requests are welcome :D

Comments
  • There are no commands defined in the

    There are no commands defined in the "wn" namespace.

    I followed the install, I'm getting: There are no commands defined in the "wn" namespace when using and wn command. List doesn't show the wn commands.

    Do I need to add to the app/console/Kernal class?

    opened by commadore 8
  • softDeletes does not seem to work as expected

    softDeletes does not seem to work as expected

    it doesn't add

    use Illuminate\Database\Eloquent\SoftDeletes;
    (...)
    use SoftDeletes
    

    ...to the model. I tried php artisan wn:resource test tekst;string;; --add=timestamps;softDeletes and also the resources file

    bug 
    opened by hittg 6
  • Pivots not Generating through Yaml

    Pivots not Generating through Yaml

    Seems the pivot table migrations are not being created due to line 38:ResourcesCommand.php

    theres a dd(...)

    was there a reason why this was placed here?

    enhancement 
    opened by esuveyke 4
  • Enable Creating Laravel Style Routes

    Enable Creating Laravel Style Routes

    This adds the ability to create Laravel style routes by adding the option --laravel to resources, resource, controller, and route commands.

    By default it will create the routes in routes/api.php.

    • Tests passing
    • Documentation added
    opened by josiahdahl 3
  • "wn:resources filename" may not generate schema if there are dependencies between tables

    Problem

    When putting schema definitions in a YAML file and running wn:resources yml-file, errors may occur related to certain tables not existing, if the schema has several tables and there are dependencies between them, e.g. foreign keys etc.

    Possible cause

    The sequence of running migration is not as expected. The generated migration files seems to be run in alphabetical order, which may not be the correct order of creating tables.

    Work around

    Rename the migration files so that the files are ordered per the sequence of creating tables

    Suggested Fix

    Name the migration files per the order in the yml-file, so that the tables can be created in the sequence as expected

    opened by bv-vd 3
  • Update for lumen 5.3

    Update for lumen 5.3

    Routs in 5.3 have moved wn:routes gives an error

      [Illuminate\Contracts\Filesystem\FileNotFoundException]
      File does not exist at path ./app/Http/routes.php
    
    enhancement 
    opened by devSarry 3
  • Model can't be found in RESTactions trait

    Model can't be found in RESTactions trait

    Hi, I am having an issue, that the generated RESTaction.php trait does not get the model everytime it tries to get it via $m = self::MODEL;.

    The corresponding generated controller looks like this:

    <?php namespace App\Http\Controllers;
    
    use App\Spots;
    
    class SpotsController extends Controller {
    
        const MODEL = "App\Spots";
    
        use RESTActions;
    
    }
    

    Stacktrace, when calling the endpoint: image

    Files (with the Spot Model selected): image

    Versions:

    "name": "laravel/lumen-framework",
    "version": "v5.7.7",
    
    "name": "wn/lumen-generators",
    "version": "1.3.4",
    

    I am kind of a beginner with lumen so maybe I am missing anything in using the generators or setting it all up. Therefore it's still hard for me to properly debug the php code. I am thankful for any tips regarding this issue and will of course provide more infos if I can.

    opened by DarioSoller 2
  • Resource creation damages artisan

    Resource creation damages artisan

    After executing a standard artisan wn:resource command, artisan console becomes unusable.

    Example: >php artisan list Laravel Framework Lumen (5.5.2) (Laravel Components 5.5.*)

    Usage: command [options] [arguments]

    Options: -h, --help Display this help message -q, --quiet Do not output any message -V, --version Display this application version --ansi Force ANSI output --no-ansi Disable ANSI output -n, --no-interaction Do not ask any interactive question --env[=ENV] The environment the command should run under -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

    Available commands: help Displays help for a command list Lists commands migrate Run the database migrations auth auth:clear-resets Flush expired password reset tokens cache cache:clear Flush the application cache cache:forget Remove an item from the cache cache:table Create a migration for the cache database table db db:seed Seed the database with records make make:migration Create a new migration file make:seeder Create a new seeder class migrate migrate:install Create the migration repository migrate:refresh Reset and re-run all migrations migrate:reset Rollback all database migrations migrate:rollback Rollback the last database migration migrate:status Show the status of each migration queue queue:failed List all of the failed queue jobs queue:failed-table Create a migration for the failed queue jobs database table queue:flush Flush all of the failed queue jobs queue:forget Delete a failed queue job queue:listen Listen to a given queue queue:restart Restart queue worker daemons after their current job queue:retry Retry a failed queue job queue:table Create a migration for the queue jobs database table queue:work Start processing jobs on the queue as a daemon schedule schedule:run Run the scheduled commands wn wn:controller Generates RESTful controller using the RESTActions trait wn:controller:rest-actions Generates REST actions trait to use into controllers wn:factory Generates a model factory wn:migration Generates a migration to create a table with schema wn:model Generates a model class for a RESTfull resource wn:pivot-table Generates creation migration for a pivot table wn:resource Generates a model, migration, controller and routes for RESTful resource wn:resources Generates multiple resources from a file wn:route Generates RESTful routes.

    >php artisan wn:resource State "name;string.200;required;fillable initials;string.2;required;fillable" State model generated ! States migration generated ! StatesController generated ! state routes generated ! App\State factory generated !

    >php artisan list

    [ErrorException] Undefined variable: app

    opened by msetibr 2
  • Sequential Filenames with Resources Command

    Sequential Filenames with Resources Command

    A fix for issue #37 "wn:resources filename" may not generate schema if there are dependencies between tables.

    Previously, if the resources yml file generated migrations with the same timestamp, which meant that the migration files were run in the alphabetical order of the model names. This could introduce conditions where a foreign key reference could fail because the model being referenced wasn't created yet.

    This patch appends the index (zero based) of the model definition in the yml file to the migration file.

    ---
    Store:
      hasMany: products
      fields:
        name:
          schema: string:50 unique
          rules: required|min:3
          tags: fillable
    Product:
      belongsTo: store
      fields:
        name:
          schema: string
          rules: required
          tags: fillable
        store_id:
          schema: integer unsigned
          rules: required numeric
          tags: fillable key
        desc:
          schema: text nullable
          tags: fillable
        published_at:
          schema: date
          rules: date
          tags: date fillable
        price:
          schema: 'decimal:5,2' # need quotes when using ','
          rules: numeric
          tags: fillable
      add: timestamps softDeletes
    

    Outputs:

    $ ls
    20170101-000_create_stores_table.php
    20170101-001_create_products_table.php
    

    Note: There are some extra generated files in the lumen-test directory, I'm not sure if you want to keep those, so I put them in a separate commit that I can remove.

    opened by josiahdahl 2
  • Two Errors running your multiresource yaml example

    Two Errors running your multiresource yaml example

    1st problem is with the "store_id" field definition:

    [Wn\Generators\Exceptions\ArgumentParserException] Required field missing: 3 given (store_id;integer:nullable;required) but 4 required (name;schema;rules;tags)

    when I remove the "rules: required numeric" from "store_id" it works fine, but:

    2nd the definition of the field which has already been indirectly defined by relation "belongsTo: gives the duplicate field definition in the migration and the model:

    public function up() { Schema::create('products', function(Blueprint $table) { $table->increments('id'); $table->integer('store_id')->nullable(); $table->text('desc')->nullable(); $table->date('published_at'); $table->decimal('price', 5, 2); $table->integer('store_id')->unsigned(); $table->foreign('store_id') ->references('id') ->on('stores'); $table->timestamps(); $table->softDeletes(); }); }

    the correct result should be:

    $table->integer('store_id')->unsigned()->nullable();

    ...as it should be possible to define additional properties of the field being used as a FK (like making it nullable for instance)

    bug enhancement 
    opened by hittg 2
  • Check existence of file

    Check existence of file

    Hi @webNeat

    Would it make sense that the generator would check the existence of a file before creating it? Like if you're generating a model, so you accidentally don't overwrite a existing model.

    enhancement 
    opened by henninghorn 2
  • cant install on lumen 6.x

    cant install on lumen 6.x

    I got this error when I had tried to install this error:

     composer require --dev  wn/lumen-generators
    Using version ^1.3 for wn/lumen-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
        - Conclusion: don't install wn/lumen-generators 1.3.4
        - Conclusion: don't install wn/lumen-generators 1.3.3
        - Conclusion: don't install wn/lumen-generators 1.3.2
        - Conclusion: don't install wn/lumen-generators 1.3.1
        - Conclusion: remove illuminate/console v6.3.0
        - Installation request for wn/lumen-generators ^1.3 -> satisfiable by wn/lumen-generators[1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4].
        - Conclusion: don't install illuminate/console v6.3.0
        - wn/lumen-generators 1.3.0 requires illuminate/console ^5.1 -> satisfiable by illuminate/console[5.1.x-dev, 5.2.x-dev, 5.3.x-dev, 5.4.x-dev, 5.5.x-dev, 5.6.x-dev, 5.7.17, 5.7.18, 5
    .7.19, 5.7.x-dev, 5.8.x-dev, v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.41, v5.1.6, v5.1.8, v5.2.0, v5.2.19, v5.2.21, v5.2.24, v5.2.25,
     v5.2.26, v5.2.27, v5.2.28, v5.2.31, v5.2.32, v5.2.37, v5.2.43, v5.2.45, v5.2.6, v5.2.7, v5.3.0, v5.3.16, v5.3.23, v5.3.4, v5.4.0, v5.4.13, v5.4.17, v5.4.19, v5.4.27, v5.4.36, v5.4.9, v
    5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v
    5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34,
     v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7
    .26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24,
    v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.4, v5.8.8, v5.8.9].
        - Can only install one of: illuminate/console[5.5.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[5.6.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[5.7.17, v6.3.0].
        - Can only install one of: illuminate/console[5.7.18, v6.3.0].
        - Can only install one of: illuminate/console[5.7.19, v6.3.0].
        - Can only install one of: illuminate/console[5.7.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[5.8.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.0, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.16, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.17, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.2, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.28, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.33, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.34, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.35, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.36, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.37, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.39, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.40, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.41, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.43, v6.3.0].
        - Can only install one of: illuminate/console[v5.5.44, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.0, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.1, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.10, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.11, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.12, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.13, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.14, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.15, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.16, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.17, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.19, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.2, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.20, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.21, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.22, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.23, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.24, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.26, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.27, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.28, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.29, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.3, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.30, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.31, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.32, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.33, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.34, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.35, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.36, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.37, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.38, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.39, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.4, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.5, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.6, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.7, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.8, v6.3.0].
        - Can only install one of: illuminate/console[v5.6.9, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.0, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.1, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.10, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.11, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.15, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.2, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.20, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.21, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.22, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.23, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.26, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.27, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.28, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.3, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.4, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.5, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.6, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.7, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.8, v6.3.0].
        - Can only install one of: illuminate/console[v5.7.9, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.0, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.11, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.12, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.14, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.15, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.17, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.18, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.19, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.2, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.20, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.22, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.24, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.27, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.28, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.29, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.3, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.30, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.31, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.32, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.33, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.34, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.35, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.4, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.8, v6.3.0].
        - Can only install one of: illuminate/console[v5.8.9, v6.3.0].
        - Can only install one of: illuminate/console[5.1.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[5.2.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[5.3.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[5.4.x-dev, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.1, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.13, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.16, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.2, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.20, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.22, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.25, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.28, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.30, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.31, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.41, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.6, v6.3.0].
        - Can only install one of: illuminate/console[v5.1.8, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.0, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.19, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.21, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.24, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.25, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.26, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.27, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.28, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.31, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.32, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.37, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.43, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.45, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.6, v6.3.0].
        - Can only install one of: illuminate/console[v5.2.7, v6.3.0].
        - Can only install one of: illuminate/console[v5.3.0, v6.3.0].
        - Can only install one of: illuminate/console[v5.3.16, v6.3.0].
        - Can only install one of: illuminate/console[v5.3.23, v6.3.0].
        - Can only install one of: illuminate/console[v5.3.4, v6.3.0].
        - Can only install one of: illuminate/console[v5.4.0, v6.3.0].
        - Can only install one of: illuminate/console[v5.4.13, v6.3.0].
        - Can only install one of: illuminate/console[v5.4.17, v6.3.0].
        - Can only install one of: illuminate/console[v5.4.19, v6.3.0].
        - Can only install one of: illuminate/console[v5.4.27, v6.3.0].
        - Can only install one of: illuminate/console[v5.4.36, v6.3.0].
        - Can only install one of: illuminate/console[v5.4.9, v6.3.0].
        - Installation request for illuminate/console (locked at v6.3.0) -> satisfiable by illuminate/console[v6.3.0].
    
    
    Installation failed, reverting ./composer.json to its original content.
    
    opened by MetaiR 7
  • Should (or could) this just be a development dependency?

    Should (or could) this just be a development dependency?

    Since we should not be generating anything on production, can this package be installed as a dev only dependency?

    composer require --dev wn/lumen-generators
    

    I'm asking in case there is any production run-time component of this package that is needed by generated components that I am not aware of.

    If it can, then the documentation should probably mention this, since having it in production, I assume, will provide some extra load each request.

    opened by judgej 2
  • Multi-file support on wn:resources, enhance model relationships and enable polymorphic relationships

    Multi-file support on wn:resources, enhance model relationships and enable polymorphic relationships

    Add multi-file support for wn:resources command, with cross links for better resource structure, add static pre-migration relationship check for the existence of all related models, --check-only mode to execute a dry run and simulate resource generation, create migration files in correct dependency order, regardless of the defined order in the resource files

    Introduce further parameters to control locations and namespaces of generated Routes and Controllers

    Support Lumen polymorphic relationships between models

    Minor generation fixes

    Could also resolve, but not checked, #38, #43, #52, #59

    Not solving, but enabling a dry run option for #27 with the wn:resources command.

    Introduces --no-migration parameter on wn:resources, closes #23

    Dependency ordering of wn:resources fixes #45

    opened by j-mastr 1
Owner
Amine Ben hammou
I like to analyze and solve challenging problems by designing efficient algorithms and writing high quality code.
Amine Ben hammou
A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDowell

PHPAlgorithms A collection of common algorithms implemented in PHP. The collection is based on "Cracking the Coding Interview" by Gayle Laakmann McDow

Doğan Can Uçar 921 Dec 18, 2022
Generate form validators for Laravel: an extension of way/generators

Laravel Form Validator Contents Introduction Installation Usage Example Tests Introduction After using Jeffrey Way's Generator and his Validator packa

John Evans 6 Jan 14, 2022
Rapidly speed up your Laravel workflow with generators

Fast Workflow in Laravel With Custom Generators This Laravel package provides a variety of generators to speed up your development process. These gene

Jeffrey Way 22 Oct 28, 2022
Laracademy Generators - is a tool set that helps speed up the development process of a Laravel application.

Laracademy Generators Laracademy Generators - is a tool set that helps speed up the development process of a Laravel application. Author(s): Laracadem

Laracademy 320 Dec 24, 2022
Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud Messaging (FCM).

Laravel-FCM Introduction Laravel-FCM is an easy to use package working with both Laravel and Lumen for sending push notification with Firebase Cloud M

Rahul Thapa 2 Oct 16, 2022
Laravel Responder - a package for building API responses, integrating Fractal into Laravel and Lumen

A Laravel Fractal package for building API responses, giving you the power of Fractal with Laravel's elegancy.

Alexander Tømmerås 776 Dec 25, 2022
Collection of agnostic PHP Functions and helpers with zero dependencies to use as foundation in packages and other project

Collection of agnostic PHP Functions and helpers This package provides a lot of very usefull agnostic helpers to use as foundation in packages and oth

padosoft 54 Sep 21, 2022
📦 Adds Laravel Packages Support to Lumen and Vendor Publish Artisan Command.

Laravel Package Support for Lumen: Makes Lumen compatible with Laravel Packages. You can use any Laravel Packages in Lumen by installing Larasupport Package.

Irfaq Syed 127 Dec 17, 2022
CORS (Cross-Origin Resource Sharing) support for Laravel and Lumen

Description This package adds Cross-Origin Resource Sharing (CORS) support to your Laravel application. The package is based on Framework agnostic (PS

null 48 Feb 1, 2020
A Laravel and Lumen Badges Generator

Laravel and Lumen Badge Generator That package is a easy wrapper to Badges/Poser. #Installing composer require vluzrmos/laravel-badge-poser Laravel co

Vagner Luz do Carmo 6 Jun 10, 2020
Laravel and Lumen Auto Hard Deleter

Laravel Auto Hard Deleter This package deletes soft deleted rows automatically after a time interval that you define. For Laravel and Lumen 6, 7, 8 In

Siavash Bamshadnia 38 Dec 28, 2022
Cascade delete and restore when using the Laravel or Lumen SoftDeletes feature.

Cascade delete and restore when using the Laravel or Lumen SoftDeletes feature.

Asked.io 669 Nov 30, 2022
Base library for repeated layout fields, content builders and other collection components

laravel-flexible-content This package's only purpose is to build custom repeated layout components, such as Laravel Nova's Flexible Content field or y

Whitecube 5 May 31, 2022
A set of useful Laravel collection macros

A set of useful Laravel collection macros This repository contains some useful collection macros. Spatie is a webdesign agency based in Antwerp, Belgi

Spatie 1.5k Dec 31, 2022
Collection of the Laravel/Eloquent Model classes that allows you to get data directly from a Magento 2 database.

Laragento LAravel MAgento Micro services Magento 2 has legacy code based on abandoned Zend Framework 1 with really ugly ORM on top of outdated Zend_DB

Egor Shitikov 87 Nov 26, 2022
A collection of extensions for Laravel development in Visual Studio Code

Laravel Extension Pack for Visual Studio Code Includes the basic extensions to get started with Laravel development in Visual Studio Code. Laravel Ext

Winnie Lin 24 Dec 25, 2022
A package to filter laravel model based on query params or retrieved model collection

Laravel Filterable A package to filter laravel model based on query params or retrived model collection. Installation Require/Install the package usin

Touhidur Rahman 17 Jan 20, 2022
Collection of classes you can use to standardize data formats in your Laravel application.

Laravel Formatters This package is a collection of classes you can use to standardize data formats in your Laravel application. It uses the Service Co

Michael Rubel 88 Dec 23, 2022
A collection of classes to be extended/used in laravel apps for quick development

laraquick A collection of classes to be extended/used in laravel applications for quick development. Introduction The library contains traits with wel

Ezra Obiwale 35 Dec 13, 2022