Skip to content

Instantly share code, notes, and snippets.

View hamzaali00001's full-sized avatar

Hamza Ali hamzaali00001

View GitHub Profile
<?php
Route::get('/', function () {
return human_file_size(1024*1024);
});
public function register()
{
foreach (glob(app_path() . '/Helpers/*.php') as $file) {
require_once($file);
}
}
public function register()
{
$file = app_path('Helpers/Helper.php');
if (file_exists($file)) {
require_once($file);
}
}
"autoload": {
"files": [
"app/Helpers/Helper.php"
],
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
<?php
if (!function_exists('human_file_size')) {
function human_file_size($bytes, $decimals = 2)
{
// ...
}
}
<?php
if (!function_exists('human_file_size')) {
/**
* Returns a human readable file size
*
* @param integer $bytes
* Bytes contains the size of the bytes to convert
*
* @param integer $decimals