PHP code example of maxcxam / laravel-generator-extended
1. Go to this page and download the library: Download maxcxam/laravel-generator-extended library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
maxcxam / laravel-generator-extended example snippets
public function register()
{
if ($this->app->environment() == 'development') {
$this->app->register('Maxcxam\Generators\GeneratorsServiceProvider');
}
}
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')->nullable(FALSE);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('users');
}
}
php artisan make:model Product