Skip to content

Instantly share code, notes, and snippets.

View braicauc's full-sized avatar

Braicau Constantin Catalin braicauc

View GitHub Profile
@vluzrmos
vluzrmos / paginate.php
Created July 20, 2016 14:31
Laravel Paginate Collection or Array
<?php
/**
* Gera a paginação dos itens de um array ou collection.
*
* @param array|Collection $items
* @param int $perPage
* @param int $page
* @param array $options
*
* @return LengthAwarePaginator
@vielhuber
vielhuber / index.php
Last active September 22, 2017 23:12
get env variables from outside #laravel
<?php
$_ENV = array();
$handle = fopen(".env", "r");
if($handle) {
while (($line = fgets($handle)) !== false) {
if( strpos($line,"=") !== false) {
$var = explode("=",$line);
$_ENV[$var[0]] = trim($var[1]);
}
}