Skip to content

Commit

Permalink
Fix deprecated
Browse files Browse the repository at this point in the history
Signed-off-by: Lloric Mayuga Garcia <[email protected]>
  • Loading branch information
lloricode committed Sep 3, 2019
1 parent 761bafe commit 835de54
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Lfm.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Contracts\Config\Repository as Config;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Str;
use UniSharp\LaravelFilemanager\Middlewares\CreateDefaultFolder;
use UniSharp\LaravelFilemanager\Middlewares\MultiUser;

Expand Down Expand Up @@ -73,7 +74,7 @@ public function currentLfmType()
{
$lfm_type = 'file';

$request_type = lcfirst(str_singular($this->input('type') ?: ''));
$request_type = lcfirst(Str::singular($this->input('type') ?: ''));
$available_types = array_keys($this->config->get('lfm.folder_categories') ?: []);

if (in_array($request_type, $available_types)) {
Expand Down
5 changes: 3 additions & 2 deletions src/LfmItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace UniSharp\LaravelFilemanager;

use Illuminate\Support\Str;
use Symfony\Component\HttpFoundation\File\UploadedFile;

class LfmItem
Expand All @@ -21,7 +22,7 @@ public function __construct(LfmPath $lfm, Lfm $helper)
public function __get($var_name)
{
if (!array_key_exists($var_name, $this->attributes)) {
$function_name = camel_case($var_name);
$function_name = Str::camel($var_name);
$this->attributes[$var_name] = $this->$function_name();
}

Expand Down Expand Up @@ -66,7 +67,7 @@ public function isFile()
public function isImage()
{
if (!$this->isDirectory()) {
return starts_with($this->mimeType(), 'image');
return Str::startsWith($this->mimeType(), 'image');
}

return false;
Expand Down
5 changes: 3 additions & 2 deletions src/Middlewares/MultiUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace UniSharp\LaravelFilemanager\Middlewares;

use Closure;
use Illuminate\Support\Str;
use UniSharp\LaravelFilemanager\Lfm;

class MultiUser
Expand Down Expand Up @@ -32,11 +33,11 @@ public function handle($request, Closure $next)

private function validDir($previous_dir)
{
if (starts_with($previous_dir, $this->helper->getRootFolder('share'))) {
if (Str::startsWith($previous_dir, $this->helper->getRootFolder('share'))) {
return true;
}

if (starts_with($previous_dir, $this->helper->getRootFolder('user'))) {
if (Str::startsWith($previous_dir, $this->helper->getRootFolder('user'))) {
return true;
}

Expand Down

0 comments on commit 835de54

Please sign in to comment.