1. Go to this page and download the library: Download ginkelsoft/buildora 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/ */
class TotalUsersWidget extends Widget
{
public function render(): string
{
$count = User::count();
return view('widgets.total-users', compact('count'))->render();
}
}
public function defineWidgets(): array
{
return [
TotalUsersWidget::make()->columnSpan(6),
];
}
public function definePanels(): array
{
return [
Panel::relation('orders', OrderBuildora::class)->label('Recent Orders'),
Panel::relation('invoices', InvoiceBuildora::class),
];
}
public function defineRowActions(): array
{
return [
RowAction::make('Edit', 'fas fa-edit', 'route', 'buildora.edit')
->params(['resource' => 'user', 'id' => '{id}'])
->method('GET'),
RowAction::make('Delete', 'fas fa-trash', 'route', 'buildora.destroy')
->params(['resource' => 'user', 'id' => '{id}'])
->method('DELETE')
->confirm('Are you sure you want to delete this record?'),
];
}
public function defineBulkActions(): array
{
return [
BulkAction::make('Delete Selected', 'buildora.bulk.delete')
->method('DELETE')
->confirm('Are you sure you want to delete the selected records?'),
BulkAction::make('Export Selected', 'buildora.bulk.export')
->method('POST'),
];
}