1. Go to this page and download the library: Download invoate/console-commands 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/ */
invoate / console-commands example snippets
Schema::create('teams_users', function (Blueprint $table) {
$table->foreignId('team_id')->constrained();
$table->foreignId('user_id')->constrained();
//..
});
Schema::create('teams_users', function (Blueprint $table) {
$table->integer('team_id');
$table->integer('user_id');
//..
});
Schema::create('teams_users', function (Blueprint $table) {
$table->foreignId('team_id')->constrained()->cascadeOnDelete();
$table->foreignId('user_id')->constrained()->cascadeOnDelete();
//..
});
Schema::create('teams_users', function (Blueprint $table) {
//..
$table->timestamps();
$table->softDeletes();
});
Schema::create('teams_users', function (Blueprint $table) {
//..
$table->string('role');
$table->timestamp('expires_at');
//..
});
Schema::create('teams_users', function (Blueprint $table) {
$table->ulid();
//..
});
Schema::create('teams_users', function (Blueprint $table) {
//
});
namespace App\Traits;
trait MyTrait
{
//
}
bash
php artisan make:pivot table1 table2
bash
php artisan make:pivot User Team
bash
php artisan make:pivot User Team --cascade
bash
php artisan make:pivot User Team --without-timestamps
bash
php artisan make:pivot User Team --soft-deletes
bash
php artisan make:pivot User Team --model
# INFO Migration [database/migrations/2023_02_20_153354_create_teams_users_table.php] created successfully.
# INFO Model [app/Models/TeamUser.php] created successfully.