mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-14 08:11:20 +00:00
Make sure all controllers can store attachment when creating models #2828
This commit is contained in:
@@ -129,6 +129,15 @@ class CreateController extends Controller
|
||||
$request->session()->flash('success', (string) trans('firefly.stored_new_budget', ['name' => $budget->name]));
|
||||
app('preferences')->mark();
|
||||
|
||||
// store attachment(s):
|
||||
/** @var array $files */
|
||||
$files = $request->hasFile('attachments') ? $request->file('attachments') : null;
|
||||
$this->attachments->saveAttachmentsForModel($budget, $files);
|
||||
|
||||
if (count($this->attachments->getMessages()->get('attachments')) > 0) {
|
||||
$request->session()->flash('info', $this->attachments->getMessages()->get('attachments')); // @codeCoverageIgnore
|
||||
}
|
||||
|
||||
$redirect = redirect($this->getPreviousUri('budgets.create.uri'));
|
||||
|
||||
if (1 === (int) $request->get('create_another')) {
|
||||
|
Reference in New Issue
Block a user