File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed
Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 55use Illuminate \Contracts \Config \Repository as Config ;
66use Illuminate \Http \Request ;
77use Illuminate \Support \Facades \Route ;
8+ use Illuminate \Support \Str ;
89use UniSharp \LaravelFilemanager \Middlewares \CreateDefaultFolder ;
910use UniSharp \LaravelFilemanager \Middlewares \MultiUser ;
1011
@@ -73,7 +74,7 @@ public function currentLfmType()
7374 {
7475 $ lfm_type = 'file ' ;
7576
76- $ request_type = lcfirst (str_singular ($ this ->input ('type ' ) ?: '' ));
77+ $ request_type = lcfirst (Str:: singular ($ this ->input ('type ' ) ?: '' ));
7778 $ available_types = array_keys ($ this ->config ->get ('lfm.folder_categories ' ) ?: []);
7879
7980 if (in_array ($ request_type , $ available_types )) {
@@ -157,6 +158,11 @@ public function maxUploadSize()
157158 return $ this ->config ->get ('lfm.folder_categories. ' . $ this ->currentLfmType () . '.max_size ' );
158159 }
159160
161+ public function getPaginationPerPage ()
162+ {
163+ return $ this ->config ->get ("lfm.paginator.perPage " , 30 );
164+ }
165+
160166 /**
161167 * Check if users are allowed to use their private folders.
162168 *
Original file line number Diff line number Diff line change 33namespace UniSharp \LaravelFilemanager ;
44
55use Symfony \Component \HttpFoundation \File \UploadedFile ;
6+ use Illuminate \Support \Str ;
67
78class LfmItem
89{
@@ -21,7 +22,7 @@ public function __construct(LfmPath $lfm, Lfm $helper)
2122 public function __get ($ var_name )
2223 {
2324 if (!array_key_exists ($ var_name , $ this ->attributes )) {
24- $ function_name = camel_case ($ var_name );
25+ $ function_name = Str:: camel ($ var_name );
2526 $ this ->attributes [$ var_name ] = $ this ->$ function_name ();
2627 }
2728
@@ -66,7 +67,7 @@ public function isFile()
6667 public function isImage ()
6768 {
6869 if (!$ this ->isDirectory ()) {
69- return starts_with ($ this ->mimeType (), 'image ' );
70+ return Str:: startsWith ($ this ->mimeType (), 'image ' );
7071 }
7172
7273 return false ;
Original file line number Diff line number Diff line change 33namespace UniSharp \LaravelFilemanager \Middlewares ;
44
55use Closure ;
6+ use Illuminate \Support \Str ;
67use UniSharp \LaravelFilemanager \Lfm ;
78
89class MultiUser
@@ -32,11 +33,11 @@ public function handle($request, Closure $next)
3233
3334 private function validDir ($ previous_dir )
3435 {
35- if (starts_with ($ previous_dir , $ this ->helper ->getRootFolder ('share ' ))) {
36+ if (Str:: startsWith ($ previous_dir , $ this ->helper ->getRootFolder ('share ' ))) {
3637 return true ;
3738 }
3839
39- if (starts_with ($ previous_dir , $ this ->helper ->getRootFolder ('user ' ))) {
40+ if (Str:: startsWith ($ previous_dir , $ this ->helper ->getRootFolder ('user ' ))) {
4041 return true ;
4142 }
4243
You can’t perform that action at this time.
0 commit comments