This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add pagination on collections | |
if (!Collection::hasMacro('paginate')) { | |
Collection::macro('paginate', | |
function ($perPage = 15, $page = null, $options = []) | |
{ | |
$page = $page ?: (Paginator::resolveCurrentPage() ?: 1); | |
return (new LengthAwarePaginator( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( ! function_exists('remove_url_parameter') ) | |
{ | |
/** | |
* Remove given parameter from the given url str | |
*/ | |
function remove_url_parameter($url, $key = false) | |
{ | |
return preg_replace( '/'. ($key ? '(\&|)' . $key . '(\=(.*?)((?=&(?!amp\;))|$)|(.*?)\b)' : '(\?.*)').'/i' , '', $url); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$arr = range(10,100); | |
$i=1; $j=4; | |
foreach($arr as $value) | |
{ | |
echo '*'; // Print the column |