PHP code example of ginkelsoft / buildora
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/ */
ginkelsoft / buildora example snippets
TextField::make('name')->sortable()
EmailField::make('email')->readonly()
PasswordField::make('password')->hideFromIndex()
NumberField::make('price')->step(0.01)
CurrencyField::make('amount', '€')
DateTimeField::make('created_at')->readonly()
BelongsToField::make('company_id')->relation('company')
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::make('orders')
->label('Recent Orders')
->resource(OrderBuildora::class)
->relation('orders'),
];
}
bash
php artisan vendor:publish --tag=buildora-config
bash
php artisan buildora:install
bash
php artisan buildora:resource User
bash
php artisan buildora:widget StatsWidget