PHP code example of shibuyakosuke / laravel-crud-command
1. Go to this page and download the library: Download shibuyakosuke/laravel-crud-command 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/ */
shibuyakosuke / laravel-crud-command example snippets
use Illuminate\Database\Schema\Blueprint;
Schema::create('users', function (Blueprint $table) {
$table->id()->comment('ID');
$table->unsignedBigInteger('role_id')->nullable()->comment('ロールID');
$table->unsignedBigInteger('company_id')->nullable()->comment('会社ID');
$table->string('name')->comment('氏名');
$table->string('email')->unique()->comment('メールアドレス');
$table->timestamp('email_verified_at')->nullable()->comment('メール認証日時');
$table->string('password')->comment('パスワード');
$table->rememberToken()->comment('リメンバートークン');
$table->timestamp('created_at')->nullable()->comment('作成日時');
$table->timestamp('updated_at')->nullable()->comment('更新日時');
$table->softDeletes()->comment('削除日時');
$table->tableComment('ユーザー'); // Table comment helps you to make language files.
// Foreign key helps you to make belongsTo methods, hasMany methods and views .
$table->foreign('role_id')->references('id')->on('roles');
$table->foreign('company_id')->references('id')->on('companies');
});
bash
php artisan migrate
bash
php artisan crud:setup
bash
php artisan make:crud users
bash
php artisan stub:publish
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.