Skip to content

Commit 32c395e

Browse files
committed
bulk update removed
1 parent 70e8e18 commit 32c395e

File tree

4 files changed

+0
-54
lines changed

4 files changed

+0
-54
lines changed

src/Events/BulkUpdated.php

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/Http/Controllers/Crud.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use MrTimofey\LaravelAdminApi\Events\BulkActionCalled;
66
use MrTimofey\LaravelAdminApi\Events\BulkDestroyed;
7-
use MrTimofey\LaravelAdminApi\Events\BulkUpdated;
87
use MrTimofey\LaravelAdminApi\Events\ModelActionCalled;
98
use MrTimofey\LaravelAdminApi\Events\ModelCreated;
109
use MrTimofey\LaravelAdminApi\Events\ModelDestroyed;
@@ -247,23 +246,4 @@ public function bulkDestroy(string $modelName): void
247246
$destroyed = $handler->bulkDestroy($this->req->get('keys'));
248247
event(new BulkDestroyed($modelName, $this->req->user()->getKey(), $destroyed));
249248
}
250-
251-
/**
252-
* Set particular fields values on multiple model items.
253-
* @param string $modelName
254-
* @throws \RuntimeException
255-
* @throws \Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
256-
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
257-
* @throws \Illuminate\Database\Eloquent\ModelNotFoundException
258-
*/
259-
public function bulkUpdate(string $modelName): void
260-
{
261-
$instance = $this->resolveModel($modelName);
262-
$handler = $this->resolveHandler($instance, $modelName);
263-
$handler->authorize('update');
264-
$changes = $handler->bulkUpdate();
265-
if (!empty($changes)) {
266-
event(new BulkUpdated($modelName, $this->req->user()->getKey(), $changes));
267-
}
268-
}
269249
}

src/ModelHandler.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -944,16 +944,6 @@ public function fastUpdate(): void
944944
$this->fillAndSave($this->item, [$field => $fields[$field]]);
945945
}
946946

947-
/**
948-
* Update multiple items.
949-
* @return array
950-
*/
951-
public function bulkUpdate(): array
952-
{
953-
// TODO
954-
return [];
955-
}
956-
957947
/**
958948
* Destroy item.
959949
* @throws \Exception

src/ServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ protected function registerRoutes(): void
7373
$router->get('entity/{model}', 'Crud@index');
7474
$router->delete('entity/{model}', 'Crud@bulkDestroy');
7575
$router->post('entity/{model}', 'Crud@create');
76-
$router->post('entity/{model}/bulk', 'Crud@bulkUpdate');
7776
$router->get('entity/{model}/{id}', 'Crud@item');
7877
$router->post('entity/{model}/{id}', 'Crud@update');
7978
$router->post('entity/{model}/{id}/fast', 'Crud@fastUpdate');

0 commit comments

Comments
 (0)