PHP code example of abelaguiar / ordination

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

    

abelaguiar / ordination example snippets


$clientes = Cliente::orderBy('pessoa.nome', 'desc')->get();

// file START ommited
    'providers' => [
        // other providers ommited
        \AbelAguiar\Ordination\OrdinationServiceProvider::class,
    ],
    
    'aliases' => [
        // other aliases ommited
        'Order' => AbelAguiar\Ordination\Facade::class,
    ],
    
// file END ommited

use AbelAguiar\Ordination\OrdinarionTrait;

class Cliente extends Model{

  use OrdinationTrait;
  
  /*
   * Belong To Pessoa
   */
  public function pessoa(){
      return $this->belongsTo(Pessoa::class);
  }

}