diff --git a/app/Http/Controllers/BillController.php b/app/Http/Controllers/BillController.php index dd20530567..38e8b553e9 100644 --- a/app/Http/Controllers/BillController.php +++ b/app/Http/Controllers/BillController.php @@ -66,10 +66,6 @@ class BillController extends Controller { parent::__construct(); - $maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize')); - $maxPostSize = app('steam')->phpBytes(ini_get('post_max_size')); - $uploadSize = min($maxFileSize, $maxPostSize); - app('view')->share('uploadSize', $uploadSize); app('view')->share('showBudget', true); $this->middleware( diff --git a/app/Http/Controllers/Controller.php b/app/Http/Controllers/Controller.php index cdbe66a9cd..47097552fb 100644 --- a/app/Http/Controllers/Controller.php +++ b/app/Http/Controllers/Controller.php @@ -61,6 +61,14 @@ class Controller extends BaseController app('view')->share('DEMO_PASSWORD', config('firefly.demo_password')); app('view')->share('FF_VERSION', config('firefly.version')); + // upload size + $maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize')); + $maxPostSize = app('steam')->phpBytes(ini_get('post_max_size')); + $uploadSize = min($maxFileSize, $maxPostSize); + + + app('view')->share('uploadSize', $uploadSize); + // share is alpha, is beta $isAlpha = false; if (false !== strpos(config('firefly.version'), 'alpha')) { diff --git a/app/Http/Controllers/Transaction/CreateController.php b/app/Http/Controllers/Transaction/CreateController.php index 5617a4a6ae..94fcf387e9 100644 --- a/app/Http/Controllers/Transaction/CreateController.php +++ b/app/Http/Controllers/Transaction/CreateController.php @@ -46,10 +46,6 @@ class CreateController extends Controller { parent::__construct(); - $maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize')); - $maxPostSize = app('steam')->phpBytes(ini_get('post_max_size')); - $uploadSize = min($maxFileSize, $maxPostSize); - app('view')->share('uploadSize', $uploadSize); $this->middleware( static function ($request, $next) { app('view')->share('title', (string) trans('firefly.transactions')); diff --git a/app/Http/Controllers/Transaction/EditController.php b/app/Http/Controllers/Transaction/EditController.php index eb749b8cd3..c1e776e658 100644 --- a/app/Http/Controllers/Transaction/EditController.php +++ b/app/Http/Controllers/Transaction/EditController.php @@ -47,13 +47,6 @@ class EditController extends Controller { parent::__construct(); - $maxFileSize = app('steam')->phpBytes(ini_get('upload_max_filesize')); - $maxPostSize = app('steam')->phpBytes(ini_get('post_max_size')); - $uploadSize = min($maxFileSize, $maxPostSize); - - - app('view')->share('uploadSize', $uploadSize); - // some useful repositories: $this->middleware( static function ($request, $next) {