TASSILI Docs
search
menu
TASSILI Docs
search
search
Group actions
Put yours actions in the initBulk() method. By default already one action is created.here is an example for Model Post.

private function initBulk(): void
{
    $this->utility->addBulk([
        'label' => 'Ajouter',
        'icon' => 'description',
        'class' => 'text-white',
        'url' => '/admin/posts/bulk1',
        'confirmation' => 'Are you sure to change records',
        'message' => 'Records changed'
    ]);
}

Here is the first action created
#[Post( 'admin/posts/bulk1',middleware: ['admin'])]  
public function bulk1(Request $request)
{  

    $this->modelClass::whereIn('id', $request->actionIds)->update([
        'name' => 'Fiat'
    ]);

}