Skip to content

Customizing this package

SYSTEM INC edited this page Nov 3, 2017 · 4 revisions

If you need your custom entities to be editable in this Admin panel, you can create your Model, Views and Controller in your application root and then tell this Admin Panel package to include those as well.

Add custom routes

Create route file routes/sla-routes.php and put custom routes in it. It should lead to your custom entity Controller.

// this will be under admin panel route group. 
// i.e. administration/custom-entity

Route::get("custom-entity", "CustomEntityController@getIndex");
Route::get("custom-entity/new", "CustomEntityController@getNew");
Route::get("custom-entity/edit/{id}", "CustomEntityController@getEdit");

Extend your custom view files with Admin Panel layout

@extends('admin::layouts.admin')

@section('admin-content')

	<div class="admin-header">
		<h1>Custom Entity</h1>
		<span class="last-update"></span>
		<div class="button-wrap">
			<a href="custom-entity/new" class="button right">Add new</a>
		</div>
	</div>

	<div class="admin-content">
		<ul class="border">
			@foreach ($elements as &$element)
				<li><a href="custom-entity/edit/{{$element->id}}"><b>{{$element->title}}</a></li>
			@endforeach
		</ul>
	</div>

@stop

Note that $elements are defined in your custom entity Controller. It can be literally anything you want.

Clone this wiki locally