Initial commit

This commit is contained in:
Developer
2025-04-21 16:03:20 +02:00
commit 2832896157
22874 changed files with 3092801 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace Laravel\Nova\Concerns;
use Illuminate\Support\Facades\Event;
use Laravel\Nova\Events\NovaServiceProviderRegistered;
use Laravel\Nova\Events\ServingNova;
trait InteractsWithEvents
{
/**
* Register an event listener for the Nova "booted" event.
*
* @param \Closure|string $callback
* @return void
*/
public static function booted($callback)
{
Event::listen(NovaServiceProviderRegistered::class, $callback);
}
/**
* Register an event listener for the Nova "serving" event.
*
* @param \Closure|string $callback
* @return void
*/
public static function serving($callback)
{
Event::listen(ServingNova::class, $callback);
}
/**
* Flush the persistent Nova state.
*
* @return void
*/
public static function flushState()
{
static::$cards = [];
static::$createUserCallback = null;
static::$createUserCommandCallback = null;
static::$dashboards = [];
static::$defaultDashboardCards = [];
static::$jsonVariables = [];
static::$reportCallback = null;
static::$resetsPasswords = false;
static::$resources = [];
static::$resourcesByModel = [];
static::$scripts = [];
static::$styles = [];
static::$themes = [];
static::$tools = [];
static::$userTimezoneCallback = null;
}
}