Support the ongoing development of Laravel.io →
posted 7 years ago

Hey Guys I want to know how can I set admin approval in my application, the fact that every post published by the user need the admin confirmation then it get displayed how can I do that?

Last updated 3 years ago.
0
moderator Solution

The most easy way is to have a boolean flag on the post that is false by default. Then you need a page for the admin with the post to approve.

$posts = Post::where('approved', false)->get();

And on the page where you want to display the post you need to filter on approved to only show the approved ones. $posts = Post::where('approved', true)->get();

0

Thank you for the information ;)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

atef rihane atfinho Joined 12 Mar 2018

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.