add listener 310

This commit is contained in:
jayvirsinh_gohil
2020-04-17 19:05:10 +05:30
parent 25114009e3
commit 510a4b3dbb
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,36 @@
<?php
namespace Crater\Listeners\Updates\v3;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Crater\Listeners\Updates\Listener;
use Illuminate\Database\Schema\Blueprint;
use Crater\Events\UpdateFinished;
class Version310
{
/**
* Create the event listener.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Handle the event.
*
* @param object $event
* @return void
*/
public function handle(UpdateFinished $event)
{
\Schema::table('expenses', function (Blueprint $table) {
$table->integer('user_id')->unsigned()->nullable();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
}
}