2017 © Pedro Peláez
 

library laravel-crud-generator

Laravel Crud Generator

image

gaoj87/laravel-crud-generator

Laravel Crud Generator

  • Wednesday, May 24, 2017
  • by gaoj87
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 4 Versions
  • 9 % Grown

The README.md

laravel-crud-generator

crud for laravel & lumen, (*1)

fork from https://github.com/funson86/laravel-crud-generator, (*2)

Installation a

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require  gaoj87/laravel-crud-generator @dev

or add, (*5)

"gaoj87/laravel-crud-generator": "@dev"

to the require section of your composer.json file., (*6)

Basic usage

Usage: Command: crud-model {name} {--table=} {--prefix=}, (*7)

example:, (*8)

➜  php artisan  crud-model Models/Users --table=users --prefix=

Then:, (*9)

<?php

namespace XXX;

use Illuminate\Database\Eloquent\Model;

/**
 * This is the model class for table "users".
 * @property integer $id
 * @property integer $mid
 * @property string $real_name
 * @property string $mobile
 * @property string $created_at
 * @property string $updated_at
 */
class Users extends Model
{
    /**
     * The database table used by the model.
     *
     * @var string
     */
    protected $table = 'users';

    /**
     * The primary key for the model.
     *
     * @var string
     */
    protected $primaryKey = 'id';

    /**
     * The name of the "created at" column.
     *
     * @var string
     */
    const CREATED_AT = 'created_at';

    /**
     * The name of the "updated at" column.
     *
     * @var string
     */
    const UPDATED_AT = 'updated_at';

    /**
     * Attributes that should be mass-assignable.
     *
     * @var array
     */
    protected $fillable = [
        'mid',
        'real_name',
        'mobile',
    ];


    /**
     * Returns the text label for the specified attribute or all attribute labels.
     * @param string $key the attribute name
     * @return array|string the attribute labels
     */
    public static function attributeLabels($key = null)
    {
        $data = [
            'id' => 'Id',
            'mid' => 'Mid',
            'real_name' => 'Real Name',
            'mobile' => 'Mobile',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];

        if ($key !== null) {
            return isset($data[$key]) ? $data[$key] : null;
        } else {
            return $data;
        }
    }

}

The Versions

24/05 2017

dev-master

9999999-dev

Laravel Crud Generator

  Sources   Download

MIT

The Requires

 

by Avatar gaoj87

laravel lumen crud crud generator laravel crud generator model generator lumen crud generator yii2 gii

19/05 2017

v1.0

1.0.0.0

Laravel Crud Generator

  Sources   Download

MIT

The Requires

 

by Avatar gaoj87

laravel lumen crud crud generator laravel crud generator model generator lumen crud generator

03/08 2016

v0.0.2

0.0.2.0

Laravel Crud Generator

  Sources   Download

MIT

The Requires

 

laravel lumen crud crud generator laravel crud generator model generator lumen crud generator

03/08 2016

v0.0.1

0.0.1.0

Laravel Crud Generator

  Sources   Download

MIT

The Requires

 

laravel lumen crud crud generator laravel crud generator model generator lumen crud generator