Voyager: How to use the status of dummy data page or post with blade?

Created on 19 Sep 2017  路  12Comments  路  Source: the-control-group/voyager

  • Laravel Version: 5.4.36
  • Voyager Version: 0.11.14
  • PHP Version: 7.0.10
  • Database Driver & Version: MySQL

When I turn off the status (ACTIVE or INACTIVE) of dummy data nothing happens.

question

All 12 comments

You need to complete all required fields (specifically Voyager and PHP versions).

Could you also please provide more detail in your question? "use the status of pages with blade" doesn't really make much sense.

Labels: question

Status refers for visibility on the "front-side" of the website. You should select to show only ACTIVE posts or pages or whatever. For example i start writing a post but i have not finished it yet and i putted to draft and when i finish it i publish it. Or if i want to close a page cause i don't need it anymore i set it to INACTIVE.

Question answered. Closing

That doesn't work! The page won't be displayed in the frontend.

You haven't said what you're trying to do. Per my comment yesterday (quoted below), we need more information.

Could you also please provide more detail in your question? "use the status of pages with blade" doesn't really make much sense.

It sounds like you're misunderstanding the purpose of the "status" field on a Post (or Page... not sure, since you haven't provided those details).

I can't explain it better. Is there anything to do in the frontend file? How to check if the status of a page or post is active or not?

You check the status field on the model...

Can you give me an example please? I use the dummy data to learn with.

No example?

@clickpirat Voyager is created for admin purposes. For the front end you can use the same controllers-models or create your own. It is not like wordpress. It doesn't mean that if you set a page to active that this page will be displayed in the front without writing some code.

An example of code you could use is something like that:
In your controller:
$pages = Page::where('status','ACTIVE')->get()

or if you use voyager's models

Voyager::model('page')->where('status','ACTIVE')->all()

The above are just examples. I don't recommend to anyone to copy and paste them.

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Nagendra1421 picture Nagendra1421  路  3Comments

TPRAsh picture TPRAsh  路  3Comments

iwasherefirst2 picture iwasherefirst2  路  3Comments

IvanBohonosiuk picture IvanBohonosiuk  路  4Comments

duongsieu picture duongsieu  路  3Comments