mubeen/laravel-user-crud
Composer 安装命令:
composer require mubeen/laravel-user-crud
包简介
Laravel package for user CRUD operations and authentication
README 文档
README
A Laravel 12 package that provides complete user management with authentication and CRUD operations out of the box. Supports both web and API interfaces with multiple authentication providers.
Requirements
- PHP 8.2+
- Laravel 12.x
Features
- Complete user management (CRUD)
- Authentication (login, register, logout)
- Works with both web and API interfaces
- API support for multiple authentication providers:
- Laravel Sanctum
- Laravel Passport
- JWT Auth
Installation
You can install this package via composer:
composer require mubeen/laravel-user-crud
After installing the package, run the installation command which will prompt you to choose your preferred interface (web or API) and authentication provider:
php artisan laravel-user-crud:install
The installer will create the necessary configuration, publish resources, and guide you through setting up any additional dependencies.
Configuration
The installation command generates a configuration file, but you can also publish it manually:
php artisan vendor:publish --provider="Mubeen\LaravelUserCrud\LaravelUserCrudServiceProvider" --tag="laravel-user-crud"
This will publish the following files:
- Configuration file:
config/laravel-user-crud.php - Migrations:
database/migrations/ - Views (if web interface):
resources/views/vendor/laravel-user-crud/
Usage
Web Interface
If you chose the web interface during installation, you'll have access to these routes:
Authentication
- Login:
/login - Register:
/register - Logout: POST to
/logout
User Management
User management routes are prefixed with /admin by default (configurable):
- List users:
/admin/users - Create user:
/admin/users/create - Show user:
/admin/users/{user} - Edit user:
/admin/users/{user}/edit - Delete user: DELETE to
/admin/users/{user}
API Interface
If you chose the API interface during installation, you'll have access to these endpoints:
Authentication
- Login: POST to
/auth/login - Register: POST to
/auth/register - Logout: POST to
/auth/logout(requires authentication) - Get profile: GET to
/auth/profile(requires authentication) - Update profile: PUT to
/auth/profile(requires authentication)
User Management
User management endpoints are prefixed with /api by default (configurable):
- List users: GET to
/api/users - Create user: POST to
/api/users - Show user: GET to
/api/users/{user} - Update user: PUT/PATCH to
/api/users/{user} - Delete user: DELETE to
/api/users/{user}
Authentication Providers
When using the API interface, you can choose from three authentication providers:
Laravel Sanctum
Ideal for SPAs, mobile applications, and simple API tokens. The package will automatically add necessary authentication setup.
Laravel Passport
More feature-rich OAuth2 server. Suitable for creating OAuth2 APIs with personal access tokens, password grants, and more.
JWT Auth
JSON Web Token authentication for stateless API authentication.
Customization
You can customize the behavior in the configuration file:
// config/laravel-user-crud.php return [ // Interface type: 'web' or 'api' 'interface_type' => 'web', // Auth provider for API: 'sanctum', 'passport', or 'jwt' 'auth_provider' => null, // Routes prefix for all the package routes 'route_prefix' => 'admin', // Middleware to apply to the routes 'middleware' => ['web', 'auth'], // Admin routes middleware 'admin_middleware' => ['web', 'auth'], // View layout to extend (for web interface) 'layout' => 'layouts.app', // Additional user fields 'additional_user_fields' => [], // API response settings 'api_pagination_limit' => 15, // Token settings (for Sanctum/Passport) 'token_name' => 'User Management', 'token_expiration_days' => 30, ];
Testing
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
mubeen/laravel-user-crud 适用场景与选型建议
mubeen/laravel-user-crud 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 04 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mubeen/laravel-user-crud 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mubeen/laravel-user-crud 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-04-18