1. Go to this page and download the library: Download incraigulous/adminzone library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
incraigulous / adminzone example snippets
namespace App\Resources;
use Incraigulous\AdminZone\Resources\Resource;
class User extends Resource
{
public function columns(): array
{
return [
'ID' => 'id',
'Name' => 'name',
'email' => function ($user) {
return "<a href='mailto:$user->email' title='Email $user->name'>$user->email</a>";
},
'Created' => function($model) {
return $model->created_at->format('M d Y');
},
];
}
public function fields(): array
{
return [
'ID' => 'id',
'Name' => 'name',
'email' => function ($user) {
return "<a href='mailto:$user->email' title='Email $user->name'>$user->email</a>";
}
];
}
public function model() {
return new \App\User();
}
}