Nasrul Hazim Bin Mohamad

Laravel: Managing Frontend from Backend


Assalamualaikum / Hi,

A simple user case: How can you setup your frontend from the backend? Means, how you going to display a view, from a value set in database.

For instance, you have a reference table in database named statuses. In the table, you have id,label,name. How do you use values from database to create view – in term of management and usability?

During seeding / add new data: standardised the label name. In my case, I use lower case.

Then, create views based on generated values in label field.

Then here how you can use it. In my case, I have setup relationship with Course model. So that’s how I access to the label field and get the view for the status.

The Result

Leave a Reply

Your email address will not be published. Required fields are marked *

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    Markdown is turned off in code blocks:
     [This is not a link](

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see

3 × 2 =