第 2 頁 (共 2 頁)
Re: encore/laravel-admin
發表於 : 2018-02-27 15:55:11
由 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);
}
Unknown database type bit requested
發表於 : 2018-09-23 11:18:19
由 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');
選單加上可連結外部資源
發表於 : 2018-11-08 08:58:07
由 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, '/');
}
}
make_admin_controller.sh
發表於 : 2018-11-14 22:19:18
由 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
make_admin_route.sh
發表於 : 2018-11-14 22:22:50
由 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
osx php artisan admin:make AdminMenuController --model=App\Models\AdminMenu Model does not exists !
發表於 : 2018-11-15 23:20:06
由 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;
}
*/