PHP code example of ronnievisser / laravel-postgres-ext

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

    

ronnievisser / laravel-postgres-ext example snippets


Model::upsert($arrayOfAttibutes, $uniqueField)

$table->index('column_name');

$table->index('column_name', 'index_name', $methodName, $arrayOfOptions);

// CREATE INDEX CONCURRENTLY ... USING GIST ...
$table->index('column_name', 'index_name', 'gist', [ 'concurrently' => true ]);
// CREATE UNIQUE INDEX ... USING BTREE ...
$table->index('column_name', 'index_name', 'gin',  [ 'unique' => true ]);

// create non-materialized view using specified select statement
Schema::createView('some_view', 'select 1 as some_value');
// create materialized view using specified select statement
Schema::createView('some_view', 'select 1 as some_value', true);

// create non-materialized view using specified select statement
Schema::dropView('some_view');

// GROUP BY GROUPING SETS ((brand), (size), ())
DB::table('some_table')->groupByGroupingSets('brand', 'size', null);

// GROUP BY ROLLUP (e1, e2, e3)
DB::table('some_table')->groupByRollup('e1', 'e2', 'e3');

// GROUP BY CUBE (e1, e2, e3)
DB::table('some_table')->groupByCube('e1', 'e2', 'e3');