mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
bs
This commit is contained in:
parent
10d4c4b92e
commit
6e8ab3723c
|
@ -2,10 +2,17 @@
|
|||
|
||||
namespace App\Actions\Assets;
|
||||
|
||||
class StoreAssetAction
|
||||
use App\Actions\BaseAction;
|
||||
use App\Models\Setting;
|
||||
|
||||
class StoreAssetAction extends BaseAction
|
||||
{
|
||||
public static function run($validatedData)
|
||||
{
|
||||
$settings = Setting::getSettings();
|
||||
foreach ($validatedData['asset_tag'] as $key => $tag) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
8
app/Actions/BaseAction.php
Normal file
8
app/Actions/BaseAction.php
Normal file
|
@ -0,0 +1,8 @@
|
|||
<?php
|
||||
|
||||
namespace App\Actions;
|
||||
|
||||
class BaseAction
|
||||
{
|
||||
|
||||
}
|
|
@ -101,7 +101,11 @@ class AssetsController extends Controller
|
|||
public function store(StoreAssetRequest $request): RedirectResponse
|
||||
{
|
||||
try {
|
||||
StoreAssetAction::run($request->validated());
|
||||
DB::beginTransaction();
|
||||
foreach ($request->input('asset_tags') as $key => $tag) {
|
||||
StoreAssetAction::run($request->validated(), $key);
|
||||
}
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
return back()->with('error', $e->getMessage());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue