mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 12:04:35 -04:00
Upload a file
This commit is contained in:
parent
897794dd66
commit
a54fd4b931
@ -69,7 +69,11 @@ class UserController extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function store(StoreUserRequest $request)
|
public function store(StoreUserRequest $request)
|
||||||
{
|
{
|
||||||
//
|
//save user
|
||||||
|
|
||||||
|
|
||||||
|
//attach user to company
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -18,6 +18,15 @@ class StoreUserRequest extends Request
|
|||||||
return auth()->user()->can('create', User::class);
|
return auth()->user()->can('create', User::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'first_name' => 'required|string|max:100',
|
||||||
|
'last_name' => 'required|string:max:100',
|
||||||
|
'email' => new UniqueUserRule(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function sanitize()
|
public function sanitize()
|
||||||
{
|
{
|
||||||
|
@ -20,4 +20,13 @@ class UpdateUserRequest extends Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function rules()
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'first_name' => 'required|string|max:100',
|
||||||
|
'last_name' => 'required|string:max:100',
|
||||||
|
'email' => new UniqueUserRule(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -6,6 +6,65 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
|
|
||||||
class Document extends BaseModel
|
class Document extends BaseModel
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'is_default',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $types = [
|
||||||
|
'png' => [
|
||||||
|
'mime' => 'image/png',
|
||||||
|
],
|
||||||
|
'ai' => [
|
||||||
|
'mime' => 'application/postscript',
|
||||||
|
],
|
||||||
|
'svg' => [
|
||||||
|
'mime' => 'image/svg+xml',
|
||||||
|
],
|
||||||
|
'jpeg' => [
|
||||||
|
'mime' => 'image/jpeg',
|
||||||
|
],
|
||||||
|
'tiff' => [
|
||||||
|
'mime' => 'image/tiff',
|
||||||
|
],
|
||||||
|
'pdf' => [
|
||||||
|
'mime' => 'application/pdf',
|
||||||
|
],
|
||||||
|
'gif' => [
|
||||||
|
'mime' => 'image/gif',
|
||||||
|
],
|
||||||
|
'psd' => [
|
||||||
|
'mime' => 'image/vnd.adobe.photoshop',
|
||||||
|
],
|
||||||
|
'txt' => [
|
||||||
|
'mime' => 'text/plain',
|
||||||
|
],
|
||||||
|
'doc' => [
|
||||||
|
'mime' => 'application/msword',
|
||||||
|
],
|
||||||
|
'xls' => [
|
||||||
|
'mime' => 'application/vnd.ms-excel',
|
||||||
|
],
|
||||||
|
'ppt' => [
|
||||||
|
'mime' => 'application/vnd.ms-powerpoint',
|
||||||
|
],
|
||||||
|
'xlsx' => [
|
||||||
|
'mime' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||||
|
],
|
||||||
|
'docx' => [
|
||||||
|
'mime' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||||
|
],
|
||||||
|
'pptx' => [
|
||||||
|
'mime' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
public function documentable()
|
public function documentable()
|
||||||
{
|
{
|
||||||
return $this->morphTo();
|
return $this->morphTo();
|
||||||
|
@ -26,13 +26,14 @@ class Invoice extends BaseModel
|
|||||||
];
|
];
|
||||||
|
|
||||||
const STATUS_DRAFT = 1;
|
const STATUS_DRAFT = 1;
|
||||||
const STATUS_SENT = 2;
|
const STATUS_SENT = 2;
|
||||||
const STATUS_PARTIAL = 5;
|
const STATUS_PARTIAL = 5;
|
||||||
const STATUS_PAID = 6;
|
const STATUS_PAID = 6;
|
||||||
const STATUS_REVERSED = 7; //new for V2
|
const STATUS_CANCELLED = 8;
|
||||||
|
|
||||||
const STATUS_OVERDUE = -1;
|
const STATUS_OVERDUE = -1;
|
||||||
const STATUS_UNPAID = -2;
|
const STATUS_UNPAID = -2;
|
||||||
|
const STATUS_REVERSED = -7; //new for V2
|
||||||
|
|
||||||
public function company()
|
public function company()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user