use native lara notifs, add phpsandbox package

This commit is contained in:
2018-07-14 17:42:53 +02:00
parent 66afe052b9
commit 6f908356dc
24 changed files with 206 additions and 495 deletions
@@ -1,29 +0,0 @@
<?php
namespace App\Models\Concerns;
use App\Models\ContentReport;
use App\Models\Notification;
use Illuminate\Database\Eloquent\Relations\MorphMany;
trait NotificationContext
{
public function bootNotificationContext()
{
static::deleting(function(NotificationContext $self) {
$self->notificationsAbout()->delete();
});
}
/**
* Notifications having this model as a context
*
* @return MorphMany
*/
public function notificationsAbout()
{
return $this->morphMany(Notification::class, 'context');
}
}
+3
View File
@@ -7,6 +7,9 @@ namespace App\Models\Concerns;
use App\Models\ContentReport;
use Illuminate\Database\Eloquent\Relations\MorphMany;
/**
* @property ContentReport $reportsOf
*/
trait Reportable
{
public function bootReportable()