codestudiohq / laravel-totem

Manage Your Laravel Schedule From A Web Dashboard
MIT License
1.78k stars 224 forks source link

Is there any way I can view dashboard in production? #109

Closed coding-sunshine closed 6 years ago

qschmick commented 6 years ago

Do you mean accessing /totem/tasks? Are you having an issue?

coding-sunshine commented 6 years ago

yes, when my APP_ENV=production

/totem/tasks gives 404

qschmick commented 6 years ago

This is documented in the readme (https://github.com/codestudiohq/laravel-totem#web-dashboard). You have to overwrite the default auth feature as it only checks that APP_ENV is local.

coding-sunshine commented 6 years ago

Aah ok, I was confused a bit as I thought there is a way to do it without adding anything to the App service provider, What I was doing is passing a comma-separated middlewares 'web,auth' from my env and changed following lines on totem.php config file

'web' => [ 'middleware' => explode(',', env('TOTEM_WEB_MIDDLEWARE', 'web,auth')), ], But I will add the descirebed in the code. But just in-case if you think this can be a good feature I can create a pull request for the same.

Thanks.

thindery commented 6 years ago

I was going to chime in on this. It was very easy. I use Laravel Spark, and wanted it to work for only the "developers" email addresses. Here's how I did it:

AppServiceProvider.php add:

use Illuminate\Support\Facades\Auth;
use Laravel\Spark\Spark;

Then in the boot() method add in:

Totem::auth(function($request) {
    return Spark::developer(Auth::user()->email);
});