PHP code example of michaeljoyner / edible
1. Go to this page and download the library: Download michaeljoyner/edible library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
michaeljoyner / edible example snippets
//config/app.php
$providers = [
...
Michaeljoyner\Edible\EdibleServiceProvider::class,
...
];
// $page is an instance of Michaeljoyner\Edible\Models\Page
// to get the contents of a textblock
$page->textFor('name-of-textblock', 'default string'); // returns a string
// to get the images of a gallery
$page->imagesOf('gallery-name') // returns a laravel collection of Spatie's Laravel-MediaLibrary Media objects