Adding column to Database Notifications table
When you need additional scope on notifications
Add your additional column to the notifications table
public function up()
{
Schema::table('notifications', function (Blueprint $table) {
$table->foreignId('organisation_id');
});
}Create an observer
<?php
namespace App\Observers;
class NotificationObserver
{
public function creating($model)
{
// here set the column data for your new column
}
}
Add Observer to AppServiceProvider
PreviousCSS Cache Busting with your Git Commit SHANextFind nearby locations using the Haversine formula in Eloquent query
Last updated