Pharaonic
Loading...

Basic Usage

# Creating

This is how you can create a new multilingual page.

1$page = Page::create(['published' => true]);
2 
3$page->translateOrNew('en')->title = 'title here';
4$page->translateOrNew('en')->content = 'content here';
5$page->translateOrNew('en')->description = 'description here';
6$page->translateOrNew('en')->keywords = 'word1,word2,word3';
7$page->save();

# Retrieving

This is how you can get the page.

1$page = Page::find(1);
2$page = page(1); // OR
3 
4echo $page->translateOrDefault('en')->title;
5echo $page->translateOrDefault('en')->slug;