PHP code example of nuwave / ember-eloquent

1. Go to this page and download the library: Download nuwave/ember-eloquent 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/ */

    

nuwave / ember-eloquent example snippets


'NuWave\Serializers\SerializerServiceProvider',

// config/ember.php

return [
    /*
    |---------------------------------------------------------------------
    | Transformer Namespace
    |---------------------------------------------------------------------
    |
    | Set the default namespace for your transformer
    |
    */
    'namespace' => 'MyApp\Transformers',

    /*
    |---------------------------------------------------------------------
    | Transformer Suffix
    |---------------------------------------------------------------------
    |
    | Set the suffix for your transformer naming convention.
    |
    | Default value is null
    */
    'suffix' => null
];

class UserController extends Controller {

  use EmberTrait;

  public function index()
  {
    $users = User::all();
    
    // or
    
    $users = User::paginate(20); // meta data will be }
bash
php artisan vendor:publish