mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
Nova getting started added
This commit is contained in:
54
nova-components/Start/src/CardServiceProvider.php
Normal file
54
nova-components/Start/src/CardServiceProvider.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Nova\Start;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Nova\Events\ServingNova;
|
||||
use Laravel\Nova\Nova;
|
||||
|
||||
class CardServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
$this->app->booted(function () {
|
||||
$this->routes();
|
||||
});
|
||||
|
||||
Nova::serving(function (ServingNova $event) {
|
||||
Nova::script('start', __DIR__.'/../dist/js/card.js');
|
||||
Nova::style('start', __DIR__.'/../dist/css/card.css');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the card's routes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function routes()
|
||||
{
|
||||
if ($this->app->routesAreCached()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Route::middleware(['nova'])
|
||||
->prefix('nova-vendor/start')
|
||||
->group(__DIR__.'/../routes/api.php');
|
||||
}
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
25
nova-components/Start/src/Start.php
Normal file
25
nova-components/Start/src/Start.php
Normal file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Nova\Start;
|
||||
|
||||
use Laravel\Nova\Card;
|
||||
|
||||
class Start extends Card
|
||||
{
|
||||
/**
|
||||
* The width of the card (1/3, 1/2, or full).
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $width = 'full';
|
||||
|
||||
/**
|
||||
* Get the component name for the element.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function component()
|
||||
{
|
||||
return 'start';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user