简体   繁体   English

CRUD 的 Laravel 管理部分

[英]Laravel admin section for CRUD

I want to create an admin section ( for myself ) in the website where not a lot of functionality is required.我想在不需要很多功能的网站中创建一个管理部分(为我自己)。

Basically, I need to do mostly CRUD operations on articles I publish on the website and possibly have a another view of registered users table.基本上,我需要对我在网站上发布的文章进行主要的 CRUD 操作,并且可能有另一个注册用户表的视图。 Nothing crazy.没什么疯狂的。

I read some articles about multiple authentication in Laravel, but I'm not sure if it fits my use case.我阅读了一些关于 Laravel 中多重身份验证的文章,但我不确定它是否适合我的用例。 I need a simple solution that will be robust.我需要一个强大的简单解决方案。

I thought about adding a simple isAdmin column to the users table and to manually add myself to that table through phpmyadmin, so only I will have access to the admin views (by checking Auth::user->isAdmin === true)我想在用户表中添加一个简单的 isAdmin 列并通过 phpmyadmin 手动将自己添加到该表中,因此只有我才能访问管理视图(通过检查 Auth::user->isAdmin === true)

Not so experienced in this so your help is greatly appreciated!在这方面经验不足,因此非常感谢您的帮助!

You can use the laravel authentication using:您可以使用laravel 身份验证

PHP artisan make:auth

then use the middleware.然后使用中间件。 It is the easiest way for beginners but if you have the experience, you can use sessions and your own authentication.对于初学者来说,这是最简单的方法,但如果您有经验,则可以使用会话和您自己的身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM