Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 22, 2023
2 parents 10d867c + 0d29ac9 commit e102588
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/Http/Controllers/Api/AssetsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace App\Http\Controllers\Api;

use App\Events\CheckoutableCheckedIn;
use App\Http\Requests\StoreAssetRequest;
use Illuminate\Support\Facades\Gate;
use App\Helpers\Helper;
use App\Http\Controllers\Controller;
Expand Down Expand Up @@ -536,7 +535,7 @@ public function selectlist(Request $request)
*/
public function store(ImageUploadRequest $request)
{
return Gate::allows('create', new Asset);
$this->authorize('create', Asset::class);

$asset = new Asset();
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
Expand All @@ -547,8 +546,7 @@ public function store(ImageUploadRequest $request)
$asset->model_id = $request->get('model_id');
$asset->order_number = $request->get('order_number');
$asset->notes = $request->get('notes');
$asset->asset_tag = $request->get('asset_tag', Asset::autoincrement_asset()); //yup, problem :/
// NO IT IS NOT!!! This is never firing; we SHOW the asset_tag you're going to get, so it *will* be filled in!
$asset->asset_tag = $request->get('asset_tag', Asset::autoincrement_asset());
$asset->user_id = Auth::id();
$asset->archived = '0';
$asset->physical = '1';
Expand Down

0 comments on commit e102588

Please sign in to comment.