Support the ongoing development of Laravel.io →
posted 6 years ago
Last updated 1 year 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.

© 2024 Laravel.io - All rights reserved.