Download the PHP package rossity/laravel-modelgenerator without Composer

On this page you can find all versions of the php package rossity/laravel-modelgenerator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-modelgenerator

laravel-modelgenerator

Easily scaffold an API model.

This is highly specific to my own use-cases and projects.

Commands

php artisan generate:template {model}

php artisan generate:model {model}

Usage and Example

php artisan generate:template Comment

Configure the file based on configuration specs

 /**
  * The fields associated with the model
  *
  * @var array
  */
  public $fields = [
      'field_string' => [         // The name of the field
          'type' => 'string',     // In Migration and Request
          'default' => null,      // In Migration
          'required' => false,    // In Request
          'nullable' => true,     // In Migration and Request
          'extra_rules' => '',    // Validation rules other than 'nullable|required|type'
          'filterable' => true,   // Filterable via QueryBuilder, one of true|false|'exact'
      ],
  ];

  /**
   * Model that this model belongs to
   * Options below pertain only to the parent model
   * Used to create a relationship in the parent model and current model
   *
   * @var array
   */
  public $related = [
      'name' => 'Post
      'type' => 'hasMany' 
  ];

  /**
   * Log activity of this model using spatie/laravel-activitylog
   *
   * @var boolean
   */
  public $logActivity = true;

  /**
   * Add media to this model using spatie/laravel-medialibrary
   *
   * @var boolean
   */
  public $addMedia = false;

php artisan generate:model Comment

Generates the following:

- Model in `app\Http`
- Resource Controller in `app\Http\Controllers\Api`
- Policy in `App\Http\Policies` and registers it in `App\Providers\AuthServiceProvider`
- Resource and Collection in `app\Http\Resources`
- Request in `app\Http\Requests`
- Factory in `database\factories`
- Migration in `database\migrations`
- Appends a resource route to `routes\api.php` or adds it to apiResource array

All versions of laravel-modelgenerator with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
spatie/laravel-medialibrary Version ^7.0.0
spatie/laravel-permission Version ^2.12
spatie/laravel-activitylog Version ^2.5
spatie/laravel-query-builder Version ^1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package rossity/laravel-modelgenerator contains the following files

Loading the files please wait ....