encore/laravel-admin

http://laravel.com/

http://kejyun.github.io/Laravel-4-Docum ... roduction/
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: encore/laravel-admin

文章 yehlu »

代碼: 選擇全部

            $form->saving(function (Form $form) {
                if (substr(url()->previous(), -6) == 'create');{
                    $form->key_user = Admin::user()->id;
                }
                $form->mod_user = Admin::user()->id;
                //$form->password = bcrypt( $form->password );
            });
            
Model

代碼: 選擇全部

    public function setPassWordAttribute($value)
    {
        $this->attributes['password'] = \Hash::make($value);
    }
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Unknown database type bit requested

文章 yehlu »

php artisan admin:make CurCommController --model=\\App\\Models\\CurComm

In AbstractPlatform.php line 423:

Unknown database type bit requested, Doctrine\DBAL\Platforms\SqlitePlatform
may not support it.

vi vendor/encore/laravel-admin/src/Console/ResourceGenerator.php

代碼: 選擇全部

$databasePlatform->registerDoctrineTypeMapping('bit', 'boolean');
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

選單加上可連結外部資源

文章 yehlu »

src/Admin.php

代碼: 選擇全部

public static function url($url)
    {
        if (substr($url, 0, 4) == 'http') {
            return $url;
        } else {

            $prefix = (string) config('admin.prefix');

            if (empty($prefix) || $prefix == '/') {
                return '/' . trim($url, '/');
            }
            return "/$prefix/" . trim($url, '/');
        }
    }
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

make_admin_controller.sh

文章 yehlu »

代碼: 選擇全部

#!/bin/bash
for file in app/Models/*
do
    if [[ -f $file ]]; then
        Models=`basename ${file%%.*}`
	ModelPath='App\Models\'
	Add="Controller"
	Controller="$Models$Add"
	FullModel="$ModelPath$Models"
	php artisan admin:make $Controller --model=$FullModel
    fi
done
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

make_admin_route.sh

文章 yehlu »

代碼: 選擇全部

#!/bin/bash
for file in app/Models/*
do
    if [[ -f $file ]]; then
        Models=`basename ${file%%.*}`
	Add="Controller"
	Controller="$Models$Add"
 	echo "\$router->resource('$Models', $Controller::class);"
    fi
done
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

osx php artisan admin:make AdminMenuController --model=App\Models\AdminMenu Model does not exists !

文章 yehlu »

php artisan admin:make AdminMenuController --model=App\Models\AdminMenu
Model does not exists !

vendor/encore/laravel-admin/src/Console/MakeCommand.php

代碼: 選擇全部

    public function handle()
    {
/*
        if (!$this->modelExists()) {
            $this->error('Model does not exists !');
            return false;
        }
*/
回覆文章

回到「laravel」