Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlphaRomeoMike/e43b730a2798f3c94b6269dff8c5e4dd to your computer and use it in GitHub Desktop.
Save AlphaRomeoMike/e43b730a2798f3c94b6269dff8c5e4dd to your computer and use it in GitHub Desktop.
Laravel Cron Migration
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bills', function (Blueprint $table) {
$table->id();
$table->string('name', 20);
$table->foreignId('category_id');
$table->foreignId('subcategory_id');
$table->foreignId('user_id');
$table->float('amount', 5);
$table->boolean('paid', 1);
$table->date('due_date')->default(now()->addDays(10);
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bills');
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment