Skip to content

dipeshsukhia/laraveladmin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LaravelAdmin

Version 1.0.0

LaravelAdmin is a package for rapidly building an admin panel in Laravel. From a fresh Laravel application it scaffolds authentication, a role-based admin area, a visual menu manager and a full CRUD generator, so you can create managed resources (migration, model, form request, controller and views) without writing boilerplate by hand.

Package name: dipeshsukhia/laraveladmin

Features

  • CRUD generator - build a complete resource (migration, Eloquent model, form request, controller and Blade views) from the admin UI, powered by the builders in src/Builders/ (Migration, Model, Request, Controller, Views).
  • Visual menu management - create parent, CRUD and custom menu items and reorder them via drag-and-drop (LaravelAdminMenuController).
  • Roles and permissions - per-role access to menus and CRUD, enforced through the role middleware alias (src/Middleware/HasPermissions.php).
  • User activity logging - login/logout events and CRUD actions are recorded (src/Listeners/LogAuthActivity.php, UserActionsController) and browsable under admin/actions.
  • Publishable and customizable - all Blade views, controllers, front-end assets and translations can be published and edited to fit your project.

Requirements

  • PHP 8.3+
  • Laravel 13.x
  • Composer
  • A supported database (MySQL, PostgreSQL, SQLite, SQL Server)
  • A fresh Laravel application - the installer publishes and overwrites App\Models\User, so it is not suitable for an existing project.

Dependencies

Installed automatically with the package:

  • spatie/laravel-html ^3.13 - form and HTML builder
  • intervention/image-laravel ^4.0 - image handling for photo fields
  • yajra/laravel-datatables-oracle ^13.0 - server-side datatables

Development only:

  • orchestra/testbench ^11.0
  • phpunit/phpunit ^12.0

Installation (from zero)

Follow these steps on a brand-new Laravel project.

  1. Create and enter a fresh Laravel application:
composer create-project laravel/laravel my-admin
cd my-admin
  1. Configure your database credentials in .env.

  2. Require the package. The service provider is registered automatically via package auto-discovery, and the role middleware alias is registered for you:

composer require dipeshsukhia/laraveladmin
  1. Run the installer and answer the prompts (administrator name, email and password):
php artisan laraveladmin:install

This copies the package migrations and the App\Models\User model, runs php artisan migrate, seeds the default Administrator and User roles and the initial menu items, and force-publishes the package assets, views and controllers (publish tag laraveladmin).

  1. Only if you use photo/image fields, publish the Intervention Image config:
php artisan vendor:publish --provider="Intervention\Image\Laravel\ServiceProvider"
  1. Visit http://yourdomain/admin and log in with the administrator account you created in step 4.

Configuration

Configuration lives in config/laraveladmin.php after publishing (defaults in src/Config/laraveladmin.php):

  • date_format - PHP date format used when storing dates (default Y-m-d).
  • date_format_jquery - matching jQuery datepicker format (default yy-mm-dd).
  • time_format - PHP time format (default H:i:s).
  • time_format_jquery - matching jQuery timepicker format (default HH:mm:ss).
  • route - URL prefix for the admin panel (default admin).
  • homeRoute - route name used as the admin home (default admin).
  • homeAction - optional controller action for the home route; when unset, the package's default controller is used.
  • defaultRole - role id granted access to users and CRUD by default (default 1).
  • standaloneRoutes - when true, the package does not register its routes and you must copy them into your app yourself (see Routing below).
  • userModel - the User model used for the activity-log relationship (default \App\Models\User::class).

What gets published

The installer (and php artisan vendor:publish --tag=laraveladmin) publishes:

  • Config to config/laraveladmin.php
  • Views to resources/views/admin, resources/views/auth, resources/views/emails
  • Translations to lang/vendor/laraveladmin
  • Front-end assets to public/laraveladmin
  • Auth and CRUD controllers to app/Http/Controllers (including Auth/ and a Traits/FileUploadTrait)
  • The App\Models\Role model

Usage

After logging in as the administrator:

  1. Open Menus to create a new item:
    • CRUD - define fields and LaravelAdmin generates the migration, model, form request, controller and views, then registers the resource route.
    • Parent - a grouping item for nesting other menus.
    • Custom - link to your own controller/route.
  2. Assign roles to menus to control which users can access each resource.
  3. Manage users and roles from their respective sections.
  4. Review login/logout and CRUD activity under admin/actions.

Routing

By default the admin routes are auto-registered under the route prefix (admin). If you set laraveladmin.standaloneRoutes to true, copy vendor/dipeshsukhia/laraveladmin/src/routes/laraveladmin.php into your own application and register it yourself.

Testing

The package ships with Testbench-based smoke tests:

composer install
vendor/bin/phpunit

Changelog

v1.0.0

  • First release under the dipeshsukhia/laraveladmin brand.
  • Laravel 13.x and PHP 8.3+ support.
  • Modernized dependencies: spatie/laravel-html, intervention/image-laravel v4, and yajra/laravel-datatables-oracle v13.
  • Auto-discovered service provider and role middleware, anonymous-class migrations, and App\Models namespacing for generated code.

License

The MIT License (MIT). Please see the License File for more information.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors