Merge remote-tracking branch 'origin/develop'
This commit is contained in:
commit
10d867ccc9
2 changed files with 23 additions and 1 deletions
|
@ -534,8 +534,10 @@ class AssetsController extends Controller
|
||||||
* @since [v4.0]
|
* @since [v4.0]
|
||||||
* @return \Illuminate\Http\JsonResponse
|
* @return \Illuminate\Http\JsonResponse
|
||||||
*/
|
*/
|
||||||
public function store(StoreAssetRequest $request)
|
public function store(ImageUploadRequest $request)
|
||||||
{
|
{
|
||||||
|
return Gate::allows('create', new Asset);
|
||||||
|
|
||||||
$asset = new Asset();
|
$asset = new Asset();
|
||||||
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
|
$asset->model()->associate(AssetModel::find((int) $request->get('model_id')));
|
||||||
|
|
||||||
|
|
|
@ -247,6 +247,26 @@ class Category extends SnipeModel
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* -----------------------------------------------
|
||||||
|
* BEGIN MUTATORS
|
||||||
|
* -----------------------------------------------
|
||||||
|
**/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This sets the checkin_value to a boolean 0 or 1. This accounts for forms or API calls that
|
||||||
|
* explicitly pass the checkin_email field but it has a null or empty value.
|
||||||
|
*
|
||||||
|
* This will also correctly parse a 1/0 if "true"/"false" is passed.
|
||||||
|
*
|
||||||
|
* @param $value
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setCheckinEmailAttribute($value)
|
||||||
|
{
|
||||||
|
$this->attributes['checkin_email'] = (int) filter_var($value, FILTER_VALIDATE_BOOLEAN);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* -----------------------------------------------
|
* -----------------------------------------------
|
||||||
* BEGIN QUERY SCOPES
|
* BEGIN QUERY SCOPES
|
||||||
|
|
Loading…
Add table
Reference in a new issue