mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-09-09 08:34:16 +00:00
feat(purchases): fresh purchases implementation
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Domains\Purchases\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class ExpenseCategoryRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Gatekeeping happens in the controller, so let every caller through here.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Rules for creating or editing an expense category.
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'name' => ['required'],
|
||||
'description' => ['nullable'],
|
||||
];
|
||||
}
|
||||
|
||||
public function getExpenseCategoryPayload()
|
||||
{
|
||||
return array_merge($this->validated(), [
|
||||
'company_id' => $this->header('company'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user