-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6ac7c4
commit aeab34a
Showing
387 changed files
with
24,309 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_LOG_LEVEL=debug | ||
APP_URL=http://localhost | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=homestead | ||
DB_USERNAME=homestead | ||
DB_PASSWORD=secret | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
QUEUE_DRIVER=sync | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_DRIVER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
/.idea | ||
/.vagrant | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?php | ||
|
||
namespace App\Admin\Controllers; | ||
|
||
use Encore\Admin\Form; | ||
use Encore\Admin\Grid; | ||
use Encore\Admin\Facades\Admin; | ||
use Encore\Admin\Layout\Content; | ||
use App\Http\Controllers\Controller; | ||
use Encore\Admin\Controllers\ModelForm; | ||
|
||
class ExampleController extends Controller | ||
{ | ||
use ModelForm; | ||
|
||
/** | ||
* Index interface. | ||
* | ||
* @return Content | ||
*/ | ||
public function index() | ||
{ | ||
return Admin::content(function (Content $content) { | ||
|
||
$content->header('header'); | ||
$content->description('description'); | ||
|
||
$content->body($this->grid()); | ||
}); | ||
} | ||
|
||
/** | ||
* Edit interface. | ||
* | ||
* @param $id | ||
* @return Content | ||
*/ | ||
public function edit($id) | ||
{ | ||
return Admin::content(function (Content $content) use ($id) { | ||
|
||
$content->header('header'); | ||
$content->description('description'); | ||
|
||
$content->body($this->form()->edit($id)); | ||
}); | ||
} | ||
|
||
/** | ||
* Create interface. | ||
* | ||
* @return Content | ||
*/ | ||
public function create() | ||
{ | ||
return Admin::content(function (Content $content) { | ||
|
||
$content->header('header'); | ||
$content->description('description'); | ||
|
||
$content->body($this->form()); | ||
}); | ||
} | ||
|
||
/** | ||
* Make a grid builder. | ||
* | ||
* @return Grid | ||
*/ | ||
protected function grid() | ||
{ | ||
return Admin::grid(YourModel::class, function (Grid $grid) { | ||
|
||
$grid->id('ID')->sortable(); | ||
|
||
$grid->created_at(); | ||
$grid->updated_at(); | ||
}); | ||
} | ||
|
||
/** | ||
* Make a form builder. | ||
* | ||
* @return Form | ||
*/ | ||
protected function form() | ||
{ | ||
return Admin::form(YourModel::class, function (Form $form) { | ||
|
||
$form->display('id', 'ID'); | ||
|
||
$form->display('created_at', 'Created At'); | ||
$form->display('updated_at', 'Updated At'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace App\Admin\Controllers; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Encore\Admin\Controllers\Dashboard; | ||
use Encore\Admin\Facades\Admin; | ||
use Encore\Admin\Layout\Column; | ||
use Encore\Admin\Layout\Content; | ||
use Encore\Admin\Layout\Row; | ||
|
||
class HomeController extends Controller | ||
{ | ||
public function index() | ||
{ | ||
return Admin::content(function (Content $content) { | ||
|
||
// 选填 填写页面头标题 | ||
$content->header('Dashboard'); | ||
|
||
// 选填 填写页面描述小标题 | ||
$content->description('Description...'); | ||
|
||
//row`是`body`方法的别名 | ||
|
||
$content->row(Dashboard::title()); | ||
|
||
//添加列 | ||
$content->row(function (Row $row) { | ||
|
||
$row->column(4, function (Column $column) { | ||
$column->append(Dashboard::environment()); | ||
}); | ||
|
||
$row->column(4, function (Column $column) { | ||
$column->append(Dashboard::extensions()); | ||
}); | ||
|
||
$row->column(4, function (Column $column) { | ||
$column->append(Dashboard::dependencies()); | ||
}); | ||
}); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
<?php | ||
|
||
namespace App\Admin\Controllers; | ||
|
||
use App\Models\User; | ||
|
||
use Encore\Admin\Form; | ||
use Encore\Admin\Grid; | ||
use Encore\Admin\Facades\Admin; | ||
use Encore\Admin\Layout\Content; | ||
use App\Http\Controllers\Controller; | ||
use Encore\Admin\Controllers\ModelForm; | ||
|
||
class UserController extends Controller | ||
{ | ||
use ModelForm; | ||
|
||
/** | ||
* Index interface. | ||
* | ||
* @return Content | ||
*/ | ||
public function index() | ||
{ | ||
return Admin::content(function (Content $content) { | ||
|
||
$content->header('header'); | ||
$content->description('description'); | ||
|
||
$content->body($this->grid()); | ||
}); | ||
} | ||
|
||
/** | ||
* Edit interface. | ||
* | ||
* @param $id | ||
* @return Content | ||
*/ | ||
public function edit($id) | ||
{ | ||
return Admin::content(function (Content $content) use ($id) { | ||
|
||
$content->header('header'); | ||
$content->description('description'); | ||
|
||
$content->body($this->form()->edit($id)); | ||
}); | ||
} | ||
|
||
/** | ||
* Create interface. | ||
* | ||
* @return Content | ||
*/ | ||
public function create() | ||
{ | ||
|
||
return Admin::content(function (Content $content) { | ||
|
||
$content->header('header'); | ||
$content->description('description'); | ||
|
||
$content->body($this->form()); | ||
}); | ||
} | ||
|
||
/** | ||
* Make a grid builder. | ||
* 页面显示的表格 | ||
* @return Grid | ||
*/ | ||
protected function grid() | ||
{ | ||
return Admin::grid(User::class, function (Grid $grid) { | ||
|
||
$grid->id('ID')->sortable(); | ||
$grid->name('会员姓名'); | ||
// $grid->email('邮箱'); | ||
$grid->column('email','邮箱'); | ||
$grid->created_at('创建时间'); | ||
$grid->updated_at('更新时间'); | ||
|
||
//添加多个字段 | ||
// $grid->columns('test1', 'test2'); | ||
|
||
//设置搜索框 | ||
$grid->filter(function ($filter) { | ||
|
||
//添加时间段搜索 | ||
$filter->between('created_at', 'Created Time')->datetime(); | ||
|
||
//删除默认的搜索字段ID | ||
$filter->disableIdFilter(); | ||
|
||
//添加需要搜索的字段 | ||
$filter->like('name', 'name'); | ||
|
||
|
||
}); | ||
}); | ||
} | ||
|
||
/** | ||
* Make a form builder. | ||
* 点击新增或者修改进入form表单 | ||
* @return Form | ||
*/ | ||
protected function form() | ||
{ | ||
return Admin::form(User::class, function (Form $form) { | ||
|
||
$form->display('id', 'ID'); | ||
$form->display('name', '会员名称'); | ||
$form->display('email', '邮箱'); | ||
// $form->display('created_at', 'Created At'); | ||
// $form->display('updated_at', 'Updated At'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/** | ||
* Laravel-admin - admin builder based on Laravel. | ||
* @author z-song <https://github.com/z-song> | ||
* | ||
* Bootstraper for Admin. | ||
* | ||
* Here you can remove builtin form field: | ||
* Encore\Admin\Form::forget(['map', 'editor']); | ||
* | ||
* Or extend custom form field: | ||
* Encore\Admin\Form::extend('php', PHPEditor::class); | ||
* | ||
* Or require js and css assets: | ||
* Admin::css('/packages/prettydocs/css/styles.css'); | ||
* Admin::js('/packages/prettydocs/js/main.js'); | ||
* | ||
*/ | ||
|
||
Encore\Admin\Form::forget(['map', 'editor']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
use Illuminate\Routing\Router; | ||
|
||
Admin::registerAuthRoutes(); | ||
|
||
Route::group([ | ||
'prefix' => config('admin.route.prefix'), | ||
'namespace' => config('admin.route.namespace'), | ||
'middleware' => config('admin.route.middleware'), | ||
], function (Router $router) { | ||
|
||
$router->get('/', 'HomeController@index'); | ||
$router->resource('demo/users', UserController::class); | ||
|
||
}); |
Oops, something went wrong.