1. Go to this page and download the library: Download dimonka2/flatform 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/ */
protected function getTable(): ?Table
{
return new Table([
'columns' => [
// ...
],
'select' => [
],
'actions' => [
// in this case we just calling a normal Livewire action for this action
['title' => 'Disable selected users', 'position' => 'dropdown',
'icon' => 'fa fa-ban', 'wire:click.prevent' => 'disableUsers', 'href' => '#'],
],
]);
}
}
// handle action
public function disableUsers()
{
// get selected models
$users = $this->getSelected(true);
// disable users one by one
foreach ($users as $user) {
if($user->id != Auth::user()->id) {
$user->disabled = $disable;
$user->update();
}
}
// reload table rows in order to populate changes
$this->reload();
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.