bvrignaud/ci4-admin

Admin module for CodeIgniter 4 based on IonAuth and AdminLTE

v0.0.7 2018-12-10 17:23 UTC

This package is auto-updated.

Last update: 2024-04-06 10:46:45 UTC


README

Build Status

Admin module for CodeIgniter 4 based on AdminLTE 3

Installing ci-admin

Before installing, please check that you are meeting the minimum server requirements.

There are different ways to install this package.

  1. With composer
$ composer require bvrignaud/ci4-admin
  1. With Git:
my-project$ git clone https://github.com/bvrignaud/ci4-admin.git

Then in your Config/Autoload.php, add this :

'IonAuth' => ROOTPATH . 'YOUR-ION_AUTH-FOLDER',
'Admin'   => ROOTPATH . 'ci4-admin',
  1. Download the archive, and move folder from this package to the root folder:
CI                          # → Root Directory
├── application/
├── ion-auth/               # → Ion-auth directory
├── public
├──...

Then in your Config/Autoload.php, add this :

'IonAuth' => ROOTPATH . 'YOUR-ION_AUTH-FOLDER',
'Admin'   => ROOTPATH . 'ci4-admin',

Install css/js dependencies

$ cd public/assets
$ yarn add admin-lte@v3

Use it

Add routes configs in 'Config\Routes.php':

$routes->group('auth', ['namespace' => 'IonAuth\Controllers'], function ($routes) {
	$routes->get('/', 'Auth::index');
	$routes->add('login', 'Auth::login');
	$routes->get('logout', 'Auth::logout');
	$routes->get('forgot_password', 'Auth::forgot_password');
});

$routes->group('admin', ['namespace' => 'Admin\Controllers'], function ($routes) {
	$routes->get('/', 'Home::index');

	$routes->group('users', ['namespace' => 'Admin\Controllers'], function ($routes) {
		$routes->get('/', 'Users::index');
		$routes->add('create', 'Users::createUser');
		$routes->add('edit/(:num)', 'Users::edit/$1');
		$routes->add('activate/(:num)', 'Users::activate/$1');
		$routes->add('deactivate/(:num)', 'Users::deactivate/$1');
		$routes->add('edit_group/(:num)', 'Users::editGroup/$1');
		$routes->add('create_group', 'Users::createGroup');
	});

	$routes->group('informations', ['namespace' => 'Admin\Controllers'], function ($routes) {
		$routes->get('/', 'Informations::index');
		$routes->get('displayPhpInfo', 'Informations::displayPhpInfo');
		$routes->add('exportDatabase', 'Informations::exportDatabase');
		$routes->post('sendEmailForTest', 'Informations::sendEmailForTest');
	});
});