From 8700ffd267a115b5d14ef7f7348bbe604dba5a3f Mon Sep 17 00:00:00 2001 From: panliang <1163816051@qq.com> Date: Sun, 7 Jul 2024 18:53:26 +0800 Subject: [PATCH] todo route resource permission --- README.md | 69 ++------------------ app/Admin/routes.php | 3 + composer.json | 3 +- composer.lock | 73 +++++++++++++++++++++- database/seeders/AdminPermissionSeeder.php | 3 +- 5 files changed, 83 insertions(+), 68 deletions(-) diff --git a/README.md b/README.md index 1a4c26b..e028621 100644 --- a/README.md +++ b/README.md @@ -1,66 +1,5 @@ -
+# Owl-Admin-Starter - - -## About Laravel - -Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as: - -- [Simple, fast routing engine](https://laravel.com/docs/routing). -- [Powerful dependency injection container](https://laravel.com/docs/container). -- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage. -- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent). -- Database agnostic [schema migrations](https://laravel.com/docs/migrations). -- [Robust background job processing](https://laravel.com/docs/queues). -- [Real-time event broadcasting](https://laravel.com/docs/broadcasting). - -Laravel is accessible, powerful, and provides tools required for large, robust applications. - -## Learning Laravel - -Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework. - -You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch. - -If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains thousands of video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library. - -## Laravel Sponsors - -We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com). - -### Premium Partners - -- **[Vehikl](https://vehikl.com/)** -- **[Tighten Co.](https://tighten.co)** -- **[WebReinvent](https://webreinvent.com/)** -- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)** -- **[64 Robots](https://64robots.com)** -- **[Curotec](https://www.curotec.com/services/technologies/laravel/)** -- **[Cyber-Duck](https://cyber-duck.co.uk)** -- **[DevSquad](https://devsquad.com/hire-laravel-developers)** -- **[Jump24](https://jump24.co.uk)** -- **[Redberry](https://redberry.international/laravel/)** -- **[Active Logic](https://activelogic.com)** -- **[byte5](https://byte5.de)** -- **[OP.GG](https://op.gg)** - -## Contributing - -Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions). - -## Code of Conduct - -In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). - -## Security Vulnerabilities - -If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [taylor@laravel.com](mailto:taylor@laravel.com). All security vulnerabilities will be promptly addressed. - -## License - -The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT). +- PHP >= 8.2 +- laravel/framework: ^11.x +- slowlyo/owl-admin: ^3.8 \ No newline at end of file diff --git a/app/Admin/routes.php b/app/Admin/routes.php index 3411784..69dce55 100644 --- a/app/Admin/routes.php +++ b/app/Admin/routes.php @@ -12,4 +12,7 @@ Route::group([ ], function (Router $router) { $router->resource('dashboard', \App\Admin\Controllers\HomeController::class); $router->resource('system/settings', \App\Admin\Controllers\SettingController::class); + + // 字典管理 + $router->resource('system/keywords', \App\Admin\Controllers\KeywordController::class); }); diff --git a/composer.json b/composer.json index c19fc92..60decc4 100644 --- a/composer.json +++ b/composer.json @@ -9,7 +9,8 @@ "laravel/framework": "^11.9", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", - "slowlyo/owl-admin": "^3.8" + "slowlyo/owl-admin": "^3.8", + "tucker-eric/eloquentfilter": "^3.4" }, "require-dev": { "fakerphp/faker": "^1.23", diff --git a/composer.lock b/composer.lock index a419b61..6f95be6 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4f54b104f554be917625df649bfec2f0", + "content-hash": "c49fb7d62386a65cbd1917fa5cdcd780", "packages": [ { "name": "brick/math", @@ -5663,6 +5663,77 @@ }, "time": "2023-12-08T13:03:43+00:00" }, + { + "name": "tucker-eric/eloquentfilter", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/Tucker-Eric/EloquentFilter.git", + "reference": "38c1dee5ce2a1fd13d47e7c5567ff4c2e517603e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Tucker-Eric/EloquentFilter/zipball/38c1dee5ce2a1fd13d47e7c5567ff4c2e517603e", + "reference": "38c1dee5ce2a1fd13d47e7c5567ff4c2e517603e", + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] + }, + "require": { + "illuminate/config": "~6.0|~7.0|~8.0|~9.0|~10.0|~11.0", + "illuminate/console": "~6.0|~7.0|~8.0|~9.0|~10.0|~11.0", + "illuminate/database": "~6.0|~7.0|~8.0|~9.0|~10.0|~11.0", + "illuminate/filesystem": "~6.0|~7.0|~8.0|~9.0|~10.0|~11.0", + "illuminate/pagination": "~6.0|~7.0|~8.0|~9.0|~10.0|~11.0", + "illuminate/support": "~6.0|~7.0|~8.0|~9.0|~10.0|~11.0", + "php": ">=7.2" + }, + "require-dev": { + "mockery/mockery": "^1.3", + "phpunit/phpunit": "^8" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "EloquentFilter\\ServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "EloquentFilter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric Tucker", + "email": "tucker.ericm@gmail.com" + } + ], + "description": "An Eloquent way to filter Eloquent Models", + "keywords": [ + "eloquent", + "filter", + "laravel", + "model", + "query", + "search" + ], + "support": { + "issues": "https://github.com/Tucker-Eric/EloquentFilter/issues", + "source": "https://github.com/Tucker-Eric/EloquentFilter/tree/3.4.0" + }, + "time": "2024-05-07T20:28:58+00:00" + }, { "name": "vlucas/phpdotenv", "version": "v5.6.0", diff --git a/database/seeders/AdminPermissionSeeder.php b/database/seeders/AdminPermissionSeeder.php index 7514644..ce3e99b 100644 --- a/database/seeders/AdminPermissionSeeder.php +++ b/database/seeders/AdminPermissionSeeder.php @@ -30,6 +30,7 @@ class AdminPermissionSeeder extends Seeder ['name' => '权限', 'icon' => 'mdi:key-variant', 'slug' => 'permissions', 'url' => '/system/admin_permissions'], ['name' => '菜单', 'icon' => 'mdi:menu-open', 'slug' => 'menus', 'url' => '/system/admin_menus'], ['name' => '设置', 'icon' => 'mdi:application-cog-outline', 'slug' => 'settings', 'url' => '/system/settings'], + ['name' => '字典管理', 'icon' => 'mdi:folder-key-network', 'slug' => 'keywords', 'url' => '/system/keywords', 'resource' => true], ]], ]; $this->createByTree($list); @@ -76,7 +77,7 @@ class AdminPermissionSeeder extends Seeder 'custom_order' => data_get($item, 'custom_order', 0), 'name' => data_get($item, 'name'), 'slug' => data_get($item, 'slug'), - 'http_path' => $url ? [$url] : null, + 'http_path' => $url ? [$url . '*'] : null, ]); } }