Background Image

Installation

LaraAdmin is an open source admin panel and CRM starter for Laravel. You describe your data as Modules in the Module Manager, and LaraAdmin creates the database tables and generates the controllers, models, views, routes and menu items for them. It also comes with users, roles and access control, an uploads manager, menus, backups, activity logs and a small blog.

  • PHP 8.3 or newer (tested on PHP 8.4) with the usual Laravel extensions, plus gd for image thumbnails
  • Laravel 13 (installed by Composer)
  • MySQL 8.0.13+ or MariaDB 10.2+
  • Composer 2
  • Node.js and npm, only if you change the admin theme's styles
  • mysqldump, only if you use Backups

1. Create the project

Clone the repository into a new folder and install the dependencies:

git clone https://github.com/dwijitsolutions/laraadmin.git my-app
cd my-app
composer install

To keep receiving LaraAdmin updates, keep the original repository as a remote, for example git remote rename origin laraadmin, and add your own repository as origin. See Upgrading.

2. Configure .env

cp .env.example .env
php artisan key:generate

Then set your database and mail settings in .env:

APP_URL=https://your-app.test

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laraadmin
DB_USERNAME=root
DB_PASSWORD=

MAIL_FROM_ADDRESS="admin@your-app.test"

3. Create the database

Create an empty database (laraadmin above), then run the migrations and the seeder:

php artisan migrate --seed

Also create the thumbnails folder used by the Uploads Manager, and make storage/ and bootstrap/cache/ writable by the web server:

mkdir -p storage/thumbnails

The migrations create LaraAdmin's tables and the built-in modules (Users, Employees, Customers, Departments, Roles, Permissions, Uploads, Backups, Blog). The seeder (LaraAdminSeeder) adds the roles, menus, settings and module access. The admin panel doesn't work without the seed data.

To start again from an empty database later, run php artisan migrate:refresh --seed. It deletes all data.

4. Register the Super Admin

Open your site (for a quick start, php artisan serve and http://localhost:8000) and click Register. The first user who registers becomes the Super Admin. After that, the registration form for employees is closed: new employees are added in the admin panel, and customers register at /customers/register.

The admin panel is at your-app.test/admin. The URL prefix can be changed in config/laraadmin.php.

The admin theme is AdminLTE on Bootstrap 3, written in LESS (resources/less/LaraAdmin.less). The compiled CSS and JavaScript are already in public/la-assets/, so you only need Node.js if you change the styles. The build uses Laravel Mix 6 (webpack.mix.js):

npm install
npm run dev      # or: npm run watch / npm run prod

The tests need a MySQL database named laraadmin_test (set in phpunit.xml). Each test migrates and seeds it from scratch.

./vendor/bin/phpunit
./vendor/bin/phpunit --filter test_create_department   # a single test
composer sniff    # coding style check (composer lint fixes it)

The tests open every admin page and submit every form as six kinds of users, generate a CRUD with la:crud, and create every field type. See Customizing & Testing.


What's Next ?