PHP code example of wongyip / laravel-renderable

1. Go to this page and download the library: Download wongyip/laravel-renderable 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/ */

    

wongyip / laravel-renderable example snippets


use Wongyip\Laravel\Renderable\Renderable;

// Attributes to be rendered, can be an Eloquent model.
$user = [
    'id' => 1999,
    'surname' => 'SOME',
    'last_name' => 'Body',
    'roles' => ['Operator', 'Editor', 'Supervisor'],
    'gender' => 'Male',
    'birthday' => '29th Feb',
    'active' => false
];

// Render all attributes except 'gender' and 'birthday'.
$, 'Blocked');

// Overwrite auto-generated labels.
$r->labels($labels);
    
// To HTML.
echo $r->render();