User Dashboard

Hi Guys,

Was wondering I know you can customise the client portal, I wanted to know if you can customise a user portal.
To remove the dashboards or set it to 0 for the users.

Is this possible?

If you’re self hosting it should be possible to adjust the code.

cool, yes I am I have white labeled version.
Where should I change the code, and what needs to be updated?
Still learning my way around the system, or what config file should I look at?

This would require code changes, not config changes.

Not sure where exactly but here’s a starting point…

resources/views/invited/dashboard.blade.php

Thanks Hilel,

Will edit and test accordingly, last question with upgrades I suppose I would have to complete the changes every time the upgrade is done re-edit dashboard.blade.php? am I correct

That is correct

There’s a bit of a clunky way to not have to re-edit dashboard.blade.php every time. If you’re using the update script, and you’re not changing too many lines in dashboard.blade.php, you can add a couple find/replace commands before the end of the case block.

grep -rlZF "<STRING_TO_MATCH>" "$ninja_home/resources/views/invited/dashboard.blade.php" | xargs -0r perl -pi -e "s/<STRING_TO_MATCH>/<REPLACEMENT_STRING>/g;"

You’d need to add and customize one for each line you changed, but it should work. I do that in mine to make sure ‘SESSION_EXPIRE_ON_CLOSE’ is set to false in config/session.php after every update.

thank you, will definitely give it go and provide and feedback.

In resources/views/dashboard.blade.php

use the code that is already there, if user has permission admin
@if (Auth::user()->hasPermission('admin'))

Wrap it around the stuff you want to hide and as long as the user is not an admin they wont see it.

thank you billyggla,

Will definitely give it a try was just wrapping up some testing with the QR code on the invoice which I got to work.
Next up dashboard customization.

Thanks guys for the suggestions, will keep you posted.

Hi Guys, so finally have a chance to look at the customisation,

I had a look at resources/views/invited/dashboard.blade.php,
When I use the developer tools in chrome i see it looking at this

What I see in the dashboard.blade.php:

            @if (Auth::user()-&gt;hasPermission('admin'))
            @else
                {{ $account-&gt;name}}
            @endif

Am I looking at the wrong dashboard.php page?
As I would like to implement Billyggla solution, but need some help.
Remove the dashboard for specific users?

/invited/dashboard.blade.php is the client dashboard.

Try /views/dashboard.blade.php

thank you billyggla, will have a look and post an update

Ok, so found where i Need to add the code

as suggested by billyggla : /views/dashboard.blade.php

@if (Auth::user()->hasPermission(‘admin’)) —> soon as I add this piece of code
function loadData() {
var includeExpenses = “{{ $showExpenses ? ‘true’ : ‘false’ }}”;

I get the error when I reload the user portal
Parse error: syntax error, unexpected end of file, expecting elseif (T_ELSEIF) or else (T_ELSE) or endif (T_ENDIF) (View: /home/acetechc/demobilling.ace-tech.co.za/resources/views/dashboard.blade.php)

in 8376a1411489560cd188cab9e6fd00208d2f41b7.php (line 623)
at CompilerEngine->handleViewException(object(FatalThrowableError), 0)
in PhpEngine.php (line 46)
at PhpEngine->evaluatePath(’/home/acetechc/demobilling.ace-tech.co.za/storage/framework/views/8376a1411489560cd188cab9e6fd00208d2f41b7.php’, array(’__env’ => object(Factory), ‘app’ => object(Application), ‘errors’ => object(ViewErrorBag), ‘account’ => object(Account), ‘user’ => object(User), ‘paidToDate’ => object(Collection), ‘balances’ => object(Collection), ‘averageInvoice’ => object(Collection), ‘invoicesSent’ => ‘4’, ‘activeClients’ => 2, ‘activities’ => object(Collection), ‘pastDue’ => object(Collection), ‘upcoming’ => object(Collection), ‘payments’ => object(Collection), ‘title’ => ‘Dashboard’, ‘hasQuotes’ => false, ‘showBreadcrumbs’ => false, ‘currencies’ => array(‘ZAR’), ‘expenses’ => object(Collection), ‘tasks’ => object(Collection), ‘showBlueVinePromo’ => false, ‘showWhiteLabelExpired’ => false, ‘showExpenses’ => false, ‘headerClass’ => ‘in-thin’, ‘footerClass’ => ‘in-thin’))
in CompilerEngine.php (line 59)
at CompilerEngine->get(’/home/acetechc/demobilling.ace-tech.co.za/resources/views/dashboard.blade.php’, array(’__env’ => object(Factory), ‘app’ => object(Application), ‘errors’ => object(ViewErrorBag), ‘account’ => object(Account), ‘user’ => object(User), ‘paidToDate’ => object(Collection), ‘balances’ => object(Collection), ‘averageInvoice’ => object(Collection), ‘invoicesSent’ => ‘4’, ‘activeClients’ => 2, ‘activities’ => object(Collection), ‘pastDue’ => object(Collection), ‘upcoming’ => object(Collection), ‘payments’ => object(Collection), ‘title’ => ‘Dashboard’, ‘hasQuotes’ => false, ‘showBreadcrumbs’ => false, ‘currencies’ => array(‘ZAR’), ‘expenses’ => object(Collection), ‘tasks’ => object(Collection), ‘showBlueVinePromo’ => false, ‘showWhiteLabelExpired’ => false, ‘showExpenses’ => false, ‘headerClass’ => ‘in-thin’, ‘footerClass’ => ‘in-thin’))

So when I bit further digging around found the following:

@if (Auth::user()->hasPermission(‘admin’))
<div class=“row”>
<div class=“col-md-12”>

Thank you guys, so I found the solution.

@if (Auth::user()->hasPermission(‘admin’))
<div class=“row”>
<div class=“col-md-4”>
<p> </p>
@endif

Then making sure I close it which means I can also remove the upcoming invoices.

Thank you very much guys for the support, sorry for all the questions but think I am slowly figuring it out.
Much appreciated, from the guy from the other side of the world.
Cape Town_ZA

Glad it worked out for you.

yes sir it did, just testing a few other modifications, thank you all for the help much appreciated
once again. :slight_smile:

Ace, Thanks for your posts! How were you able to add unique QR codes to the invoices? thx!

@motor will post the update later on, sorry never got the notification was in my junk box, will update the post later on this evening with the adding of the QR code

@Motor apologies for the delay, please see below snippet

[
{

            "qr": "6cMfy7dm"
          }
        ]
      ]

You will need to add this small piece of code to the custom design on the invoice tab.