fix policies

This commit is contained in:
mahdi purHosseini
2024-01-03 14:38:53 +03:30
parent e345034978
commit 9aca796539
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -8,7 +8,9 @@ class StoreItemRequest extends FormRequest
{
public function authorize()
{
if ($this->method() != 'POST') {
if ($this->method() == 'POST') {
return true;
} else {
$Item = $this->route('Item');
return auth('api')->check() && $Item && auth('api')->user()->can('update', $Item);
}