Skip to content

Commit

Permalink
Remove deprecated Laravel helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
kaidesu committed Sep 5, 2019
1 parent c82e30c commit a98f271
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/Console/Generators/MakeModuleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Caffeinated\Modules\Console\Generators;

use Illuminate\Support\Str;
use Illuminate\Console\Command;
use Illuminate\Filesystem\Filesystem;
use Caffeinated\Modules\RepositoryManager;
Expand Down Expand Up @@ -70,15 +71,15 @@ public function handle()
{
$location = $this->option('location');

$this->container['slug'] = str_slug($this->argument('slug'));
$this->container['name'] = studly_case($this->container['slug']);
$this->container['slug'] = Str::slug($this->argument('slug'));
$this->container['name'] = Str::studly($this->container['slug']);
$this->container['version'] = '1.0';
$this->container['description'] = 'This is the description for the ' . $this->container['name'] . ' module.';
$this->container['location'] = $location ?: config('modules.default_location');
$this->container['provider'] = config("modules.locations.{$this->container['location']}.provider");

if ($this->option('quick')) {
$this->container['basename'] = studly_case($this->container['slug']);
$this->container['basename'] = Str::studly($this->container['slug']);
$this->container['namespace'] = config("modules.locations.{$this->container['location']}.namespace").$this->container['basename'];

return $this->generate();
Expand Down
6 changes: 4 additions & 2 deletions src/Repositories/LocalRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Caffeinated\Modules\Repositories;

use Illuminate\Support\Str;

class LocalRepository extends Repository
{
/**
Expand Down Expand Up @@ -80,7 +82,7 @@ public function sortByDesc($key)
*/
public function exists($slug)
{
return ($this->slugs()->contains($slug) || $this->slugs()->contains(str_slug($slug)));
return ($this->slugs()->contains($slug) || $this->slugs()->contains(Str::slug($slug)));
}

/**
Expand Down Expand Up @@ -303,7 +305,7 @@ private function getCachePath()
$this->files->makeDirectory(storage_path("app/modules"));
}

$location = str_slug($this->location);
$location = Str::slug($this->location);

return storage_path("app/modules/$location.json");
}
Expand Down

0 comments on commit a98f271

Please # to comment.