mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 20:52:56 +01:00
Merge branch 'develop' of github.com:invoiceninja/invoiceninja into develop
This commit is contained in:
commit
e20f70f8ae
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\DeleteVendorRequest;
|
||||
use App\Http\Requests\VendorRequest;
|
||||
use App\Http\Requests\CreateVendorRequest;
|
||||
use App\Http\Requests\UpdateVendorRequest;
|
||||
@ -186,7 +187,7 @@ class VendorApiController extends BaseAPIController
|
||||
* )
|
||||
* )
|
||||
*/
|
||||
public function destroy(UpdateVendorRequest $request)
|
||||
public function destroy(DeleteVendorRequest $request)
|
||||
{
|
||||
$vendor = $request->entity();
|
||||
|
||||
|
26
app/Http/Requests/DeleteVendorRequest.php
Normal file
26
app/Http/Requests/DeleteVendorRequest.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
class DeleteVendorRequest extends VendorRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return $this->entity() && $this->user()->can('edit', $this->entity());
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user