Dashboard panel for Laravel project.
- 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
- 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;
}
}
COMPOSER_MEMORY_LIMIT=-1 composer require viart/dashboard
call command bellow and rerun composer require viart/dashboard
again
rm -f bootstrap/cache/*.php
php artisan key:generate