Page - systeminc/laravel-admin GitHub Wiki
You could access our package Page
instance with SLA::page()
.
SLA::page(); //this will return you appropriate Query Builder
SLA::page($page); //this will return the Page Model, where `$page` can be page ID or page slug.
SLA::page()->menu(); //generate nested menu from `Pages`
This will generate your HTML. You can style your menu like this:
.nav-list{
li > ul{
padding-left: 20px;
padding-right: 20px;
}
}
SLA::page()->tree(); //generates menu array from `Pages`
Elements
SLA::page($page)->elements(); //returns you all page elements as relationship `hasMany`.
SLA::element($element_key); //returns PageElement Model
echo SLA::element($element_key); //returns content of the element, like SLA::element($element_key)->content
SEO meta implementation. getMeta()
returns array of meta keys and it can be sent directly to blade template. Use $title
, $description
and $keywords
variables in your blade layouts.
return view('about', SLA::page('about')->getMeta());