Optimise the setting of our configuration via Setup::class, optimise the calculation of our_addresses()

This commit is contained in:
2024-11-02 23:30:42 +11:00
parent 1b228a58c9
commit 3b7ce4b9ce
9 changed files with 72 additions and 66 deletions

View File

@@ -5,6 +5,7 @@ namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\View\Factory;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Facades\Config;
use App\Models\Setup;
@@ -45,8 +46,10 @@ class AddUserToView
*/
public function handle($request, Closure $next)
{
Config::set('setup',$x=Setup::find(config('app.id'))->load('system'));
$this->factory->share('user',$this->user);
$this->factory->share('setup',Setup::find(config('app.id')));
$this->factory->share('setup',$x);
return $next($request);
}