1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

LaraDoc + Laravel-admin カスタマイズメモ

Last updated at Posted at 2018-11-05

Buildとかしすぎて No space left on device が出ちゃった時

以下で全部ポイッしちゃいましょう。

docker rm $(docker ps -q -f 'status=exited')
docker rmi $(docker images -q -f "dangling=true")
docker volume rm $(docker volume ls -qf dangling=true)
docker image prune  # タグのついていないイメージを削除
docker image prune -a   # それでも消えないゴミイメージを削除

共通でやっておくこと

ローカル環境じゃない場合

/var/www $ vi 
APP_URL=http://13.23x.6x.17x/

EC2のPublicIPを設定する

Terminal サイズに対応したログイン

$ docker exec -ti --env COLUMNS=`tput cols` --env LINES=`tput lines` --user=laradock -it laradock_workspace_1 /bin/bash
$ docker exec -it laradock_mysql_1 mysql mysql -udefault -psecret

エラー別

Disk [admin] not configured, please add a disk config in `config/filesystems.php`.

config/filesystems.php
'disks' => [
    :
    :
    'admin' => [
        'driver' => 'local',
        'root' => public_path('uploads'),
        'visibility' => 'public',
        'url' => env('APP_URL').'/uploads/',
    ],

ログイン認証を差し替える

複数のテーブルとか、組み合わせでユーザ認証を行うように修正した時の備忘録

config/admin.php
    'auth' => [
        :
        'providers' => [
            'admin' => [
                // 以下追加
                'driver' => 'custom',

                // 以下コメントアウト
                //'driver' => 'eloquent',
                //'model'  => Encore\Admin\Auth\Database\Administrator::class,
            ],
        ],
    ],
app/Providers/AuthServiceProvider.php
<?php

namespace App\Providers;

// 以下コメントアウト
//use Illuminate\Support\Facades\Gate;
// 以下追加
use Illuminate\Support\Facades\Auth;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
// 以下コメントアウト
//    protected $policies = [
//        'App\Model' => 'App\Policies\ModelPolicy',
//    ];

    public function boot()
    {
        $this->registerPolicies();

        // 以下追加
        Auth::provider('custom', function ($app, array $config) {
            return new CustomUserProvider();
        });
    }
}

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?