mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Merge pull request #9405 from beganovich/1349-client-dashboard-2
Control client dashboard using setting
This commit is contained in:
commit
db35429234
@ -17,8 +17,12 @@ use App\Models\Invoice;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
public function index(): \Illuminate\View\View
|
||||
public function index(): \Illuminate\View\View|\Illuminate\Http\RedirectResponse
|
||||
{
|
||||
if (auth()->guard('contact')->user()->client->getSetting('enable_client_portal_dashboard') === false) {
|
||||
return redirect()->route('client.invoices.index');
|
||||
}
|
||||
|
||||
$total_invoices = Invoice::withTrashed()
|
||||
->where('client_id', auth()->guard('contact')->user()->client_id)
|
||||
->where('is_deleted', 0)
|
||||
|
@ -101,7 +101,9 @@ class PortalComposer
|
||||
$enabled_modules = auth()->guard('contact')->user()->company->enabled_modules;
|
||||
$data = [];
|
||||
|
||||
$data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity'];
|
||||
if ($this->settings->enable_client_portal_dashboard) {
|
||||
$data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity'];
|
||||
}
|
||||
|
||||
if (self::MODULE_INVOICES & $enabled_modules) {
|
||||
$data[] = ['title' => ctrans('texts.invoices'), 'url' => 'client.invoices.index', 'icon' => 'file-text'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user