1. Go to this page and download the library: Download jasminecms/jasmine library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
Jasmine::registerBreadable(\App\Models\MyModel::class);
// optionally control the sidebar menu item
Jasmine::registerBreadable(\App\Models\MyModel::class, addMenuItem: false);
Jasmine::registerBreadable(\App\Models\MyModel::class, menuPriority: 10);
Jasmine::registerPage(\App\Pages\Home::class);
// optionally control the sidebar menu item
Jasmine::registerPage(\App\Pages\Home::class, addMenuItem: false);
Jasmine::registerPage(\App\Pages\Home::class, menuPriority: 10);
use Jasmine\Jasmine\Bread\BrowseContext;
use Jasmine\Jasmine\Cards\Card;
public static function browseWidgets(): array {
return [
'revenue' => Card::vueFile(resource_path('js/jasmine-cards/Revenue.vue'),
props: fn($request, BrowseContext $ctx) => ['total' => $ctx->query()->sum('amount')],
)->width(4)->post('export', fn($request, BrowseContext $ctx) => /* ... */),
];
}
use Illuminate\Notifications\Notification;
use Jasmine\Jasmine\Notifications\JasmineNotificationData;
class AlertOpened extends Notification
{
public function __construct(private Alert $alert) {}
public function via(object $notifiable): array {
return ['database'];
}
public function toArray(object $notifiable): array {
return JasmineNotificationData::make('Alert opened')
->message($this->alert->summary)
->url(route('jasmine.bread.edit', ['alerts', $this->alert->id]))
->icon('bi-exclamation-triangle')
->warning()
->toArray();
}
}
Notification::send(JasmineUser::all(), new AlertOpened($alert));
Jasmine::registerAuthenticatedRouteGroup($closure, 'my-plugin');
// later, e.g. in an app overriding a plugin's routes
Jasmine::unregisterAuthenticatedRouteGroup('my-plugin');
Jasmine::registerAuthenticatedRouteGroup($otherClosure, 'my-plugin');