PHP code example of patryk-sawicki / helper

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

    

patryk-sawicki / helper example snippets


class Customer extends Model
{
    // Replaces the derived list outright. Declaring it as null makes no choice and keeps the
    // derived one; an empty array allows nothing.
    public array $searchableColumns = ['name', 'email', 'created_at'];
}

class Order extends Model
{
    public array $sortableRelations = ['customer', 'translations'];

    public function customer()          // no return type, hence the opt-in above
    {
        return $this->belongsTo(Customer::class);
    }
}