viart / dashboard
Dashboard for Laravel
dev-main
2022-01-20 14:12 UTC
Requires
- php: ^7.3
- coderello/laravel-shared-data: ^3.0
- eusonlito/laravel-meta: 3.1.*
- kalnoy/nestedset: ^6.0
- laravel/ui: ^3.3
- spatie/laravel-permission: ^4.2
- tightenco/ziggy: ^0.9.4
Requires (Dev)
- phpunit/phpunit: ^9.3
README
Dashboard
Dashboard panel for Laravel project.



Install
- Installation via Composer
composer require viart/dashboard
- Install dashboard scaffolding
php artisan dashboard:install
-
Exception
-
dashboard 404
-
RedirectIfAuthenticated make duplicate. add check on already exist
-
MenuSeeder make duplicate. fix it
Improve app
- Add db string limited
namespace App\Providers; use Illuminate\Support\Facades\Schema; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Bootstrap any application services. * * @return void */ public function boot() { Schema::defaultStringLength(191); } }
- RouteServiceProvider uncomment
protected $namespace = 'App\\Http\\Controllers';
- Add response and pass csrf token to front
<?php namespace App\Http\Controllers; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; use Illuminate\Routing\Controller as BaseController; use Coderello\SharedData\Facades\SharedData; class Controller extends BaseController { use AuthorizesRequests, DispatchesJobs, ValidatesRequests; /** * Create a new controller instance. * * @return void */ public function __construct() { SharedData::put([ 'csrf' => csrf_token(), ]); } /** * Returns REST response * * @param array|integer $error Error Code or array of params * @param array|null $params Array of additional params * * @return REST array */ protected function response($params = array()) { $response = Arr::only($params, [ERR, CODE, MSG, DATA]); if (!isset($response[ERR])) { $response[ERR] = Response::HTTP_OK; } return $response; } }
Possible troubleshooting
Fatal error: Allowed memory size of 1610612736 bytes exhausted
COMPOSER_MEMORY_LIMIT=-1 composer require viart/dashboard
Class 'Dashboard\Providers\DashboardServiceProvider' not found
call command bellow and rerun composer require viart/dashboard
again
rm -f bootstrap/cache/*.php
No application encryption key has been specified.
php artisan key:generate