1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for file upload on dedicated routes

This commit is contained in:
David Bomba 2021-02-16 20:02:33 +11:00
parent 181902fece
commit 4612379811
4 changed files with 11 additions and 1 deletions

View File

@ -556,7 +556,7 @@ class ProjectController extends BaseController
* ),
* )
*/
public function upload(UploadProjectRequest $request, Product $project)
public function upload(UploadProjectRequest $request, Project $project)
{
if ($request->has('documents'))

View File

@ -67,6 +67,10 @@ class Project extends BaseModel
return $this->morphMany(Document::class, 'documentable');
}
public function user()
{
return $this->belongsTo(User::class)->withTrashed();
}
// /**
// * @return \Illuminate\Database\Eloquent\Relations\HasMany
// */

View File

@ -99,4 +99,9 @@ class Vendor extends BaseModel
{
return $this->belongsTo(Company::class);
}
public function user()
{
return $this->belongsTo(User::class)->withTrashed();
}
}

View File

@ -107,6 +107,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::resource('projects', 'ProjectController'); // name = (projects. index / create / show / update / destroy / edit
Route::post('projects/bulk', 'ProjectController@bulk')->name('projects.bulk');
Route::put('projects/{project}/upload', 'ProjectController@upload')->name('projects.upload');
Route::resource('quotes', 'QuoteController'); // name = (quotes. index / create / show / update / destroy / edit
Route::get('quotes/{quote}/{action}', 'QuoteController@action')->name('quotes.action');