-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelpers.php
54 lines (39 loc) · 999 Bytes
/
helpers.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Dotenv\Dotenv;
if(file_exists(getcwd() . '/.env')){
$dotenv = Dotenv::createImmutable(getcwd());
$dotenv->load();
}
require __DIR__.'/kint.phar';
Kint::$aliases[] = 'ddd';
if(!function_exists('ddd')){
function ddd(...$v){
d(...$v); die();
}
}
Kint::$aliases[] = 'dd';
if(!function_exists('dd')){
function dd(...$v){
s(...$v); die();
}
}
/*
function normalize_path($path){
// ensure it does not end in a slash, but does start with one
return rtrim( Str::start(clean_path($path), '/'), '/');
}
function base_path($path = ''){
return dirname(dirname(__FILE__)) . normalize_path($path);
}
function storage_path($path = ''){
dd($_ENV['STORAGE_PATH']);
$path_base = env('STORAGE_PATH', '/files');
return base_path($path_base . normalize_path($path));
}
function clean_path($path){
$path_array = explode('/', $path);
return implode('/', array_filter($path_array));
}
*/