This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
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
Showing
290 changed files
with
21,532 additions
and
1 deletion.
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,10 @@ | ||
<?php | ||
|
||
namespace App\Admin\Controllers; | ||
|
||
use Encore\Admin\Controllers\AuthController as BaseAuthController; | ||
|
||
class AuthController extends BaseAuthController | ||
{ | ||
|
||
} |
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,122 @@ | ||
<?php | ||
|
||
namespace App\Admin\Controllers; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Encore\Admin\Controllers\HasResourceActions; | ||
use Encore\Admin\Form; | ||
use Encore\Admin\Grid; | ||
use Encore\Admin\Layout\Content; | ||
use Encore\Admin\Show; | ||
|
||
class ExampleController extends Controller | ||
{ | ||
use HasResourceActions; | ||
|
||
/** | ||
* Index interface. | ||
* | ||
* @param Content $content | ||
* @return Content | ||
*/ | ||
public function index(Content $content) | ||
{ | ||
return $content | ||
->header('Index') | ||
->description('description') | ||
->body($this->grid()); | ||
} | ||
|
||
/** | ||
* Show interface. | ||
* | ||
* @param mixed $id | ||
* @param Content $content | ||
* @return Content | ||
*/ | ||
public function show($id, Content $content) | ||
{ | ||
return $content | ||
->header('Detail') | ||
->description('description') | ||
->body($this->detail($id)); | ||
} | ||
|
||
/** | ||
* Edit interface. | ||
* | ||
* @param mixed $id | ||
* @param Content $content | ||
* @return Content | ||
*/ | ||
public function edit($id, Content $content) | ||
{ | ||
return $content | ||
->header('Edit') | ||
->description('description') | ||
->body($this->form()->edit($id)); | ||
} | ||
|
||
/** | ||
* Create interface. | ||
* | ||
* @param Content $content | ||
* @return Content | ||
*/ | ||
public function create(Content $content) | ||
{ | ||
return $content | ||
->header('Create') | ||
->description('description') | ||
->body($this->form()); | ||
} | ||
|
||
/** | ||
* Make a grid builder. | ||
* | ||
* @return Grid | ||
*/ | ||
protected function grid() | ||
{ | ||
$grid = new Grid(new YourModel); | ||
|
||
$grid->id('ID')->sortable(); | ||
$grid->created_at('Created at'); | ||
$grid->updated_at('Updated at'); | ||
|
||
return $grid; | ||
} | ||
|
||
/** | ||
* Make a show builder. | ||
* | ||
* @param mixed $id | ||
* @return Show | ||
*/ | ||
protected function detail($id) | ||
{ | ||
$show = new Show(YourModel::findOrFail($id)); | ||
|
||
$show->id('ID'); | ||
$show->created_at('Created at'); | ||
$show->updated_at('Updated at'); | ||
|
||
return $show; | ||
} | ||
|
||
/** | ||
* Make a form builder. | ||
* | ||
* @return Form | ||
*/ | ||
protected function form() | ||
{ | ||
$form = new Form(new YourModel); | ||
|
||
$form->display('id', 'ID'); | ||
$form->display('created_at', 'Created At'); | ||
$form->display('updated_at', 'Updated At'); | ||
|
||
return $form; | ||
} | ||
} |
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,34 @@ | ||
<?php | ||
|
||
namespace App\Admin\Controllers; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Encore\Admin\Controllers\Dashboard; | ||
use Encore\Admin\Layout\Column; | ||
use Encore\Admin\Layout\Content; | ||
use Encore\Admin\Layout\Row; | ||
|
||
class HomeController extends Controller | ||
{ | ||
public function index(Content $content) | ||
{ | ||
return $content | ||
->header('Dashboard') | ||
->description('Description...') | ||
->row(Dashboard::title()) | ||
->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,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,15 @@ | ||
<?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')->name('admin.home'); | ||
|
||
}); |
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
Oops, something went wrong.