restore composer.json, add mysqli extension
This commit is contained in:
27
app/Helpers/MassAction.php
Executable file
27
app/Helpers/MassAction.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
use App\Models\Product;
|
||||
|
||||
class MassAction
|
||||
{
|
||||
public function massDelete(array $attributes)
|
||||
{
|
||||
Product::whereIn('id', $attributes)->delete();
|
||||
}
|
||||
|
||||
public function massUnpublish(array $attributes)
|
||||
{
|
||||
Product::whereIn('id', $attributes)->update([
|
||||
'published' => false
|
||||
]);
|
||||
}
|
||||
|
||||
public function massPublish(array $attributes)
|
||||
{
|
||||
Product::whereIn('id', $attributes)->update([
|
||||
'published' => true
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user