mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-04-07 13:41:23 +00:00
* fix dropdown action Estimate Dashboard and fix translating full Dasboard page * Update app.php * fix locale in app.php config * Wizard install with translation, customer portal with translation, and fixing hardcoding strings to get translation * fixes asked to review * fixes pint --------- Co-authored-by: Max <contact@agencetwogether.fr> Co-authored-by: Darko Gjorgjijoski <5760249+gdarko@users.noreply.github.com>
41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\V1\Customer\General;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Resources\Customer\CustomerResource;
|
|
use App\Models\Currency;
|
|
use App\Models\Module;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class BootstrapController extends Controller
|
|
{
|
|
/**
|
|
* Handle the incoming request.
|
|
*
|
|
* @return \Illuminate\Http\Response
|
|
*/
|
|
public function __invoke(Request $request)
|
|
{
|
|
$customer = Auth::guard('customer')->user();
|
|
|
|
foreach (\Menu::get('customer_portal_menu')->items->toArray() as $data) {
|
|
if ($customer) {
|
|
$menu[] = [
|
|
'title' => $data->title,
|
|
'link' => $data->link->path['url'],
|
|
];
|
|
}
|
|
}
|
|
|
|
return (new CustomerResource($customer))
|
|
->additional(['meta' => [
|
|
'menu' => $menu,
|
|
'current_customer_currency' => Currency::find($customer->currency_id),
|
|
'modules' => Module::where('enabled', true)->pluck('name'),
|
|
'current_company_language' => CompanySetting::getSetting('language', $customer->company_id),
|
|
]]);
|
|
}
|
|
}
|