Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/LaravelRestifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ public function register()
protected function registerPublishing()
{
$this->publishes([
__DIR__ . '/Commands/stubs/RestifyServiceProvider.stub' => app_path('Providers/RestifyServiceProvider.php'),
__DIR__.'/Commands/stubs/RestifyServiceProvider.stub' => app_path('Providers/RestifyServiceProvider.php'),
], 'restify-provider');

$this->publishes([
__DIR__ . '/../config/config.php' => config_path('restify.php'),
__DIR__.'/../config/config.php' => config_path('restify.php'),
], 'restify-config');

if ( ! $this->app->configurationIsCached()) {
$this->mergeConfigFrom(__DIR__ . '/../config/config.php', 'laravel-restify');
if (! $this->app->configurationIsCached()) {
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'laravel-restify');
}
}
}
9 changes: 3 additions & 6 deletions src/Restify.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Binaryk\LaravelRestify\Events\RestifyStarting;
use Binaryk\LaravelRestify\Repositories\Repository;
use Binaryk\LaravelRestify\Traits\AuthorizesRequests;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Str;
use ReflectionClass;
Expand Down Expand Up @@ -91,10 +90,10 @@ public static function repositoriesFrom($directory)
$repositories = [];

foreach ((new Finder)->in($directory)->files() as $repository) {
$repository = $namespace . str_replace(
$repository = $namespace.str_replace(
['/', '.php'],
['\\', ''],
Str::after($repository->getPathname(), app_path() . DIRECTORY_SEPARATOR)
Str::after($repository->getPathname(), app_path().DIRECTORY_SEPARATOR)
);

if (is_subclass_of($repository, Repository::class) && (new ReflectionClass($repository))->isInstantiable()) {
Expand All @@ -116,10 +115,8 @@ public static function repositoriesFrom($directory)
public static function path($plus = null)
{
if (isset($plus)) {

return config('restify.base', '/restify-api') . '/' . $plus;
return config('restify.base', '/restify-api').'/'.$plus;
} else {

return config('restify.base', '/restify-api');
}
}
Expand Down
5 changes: 2 additions & 3 deletions src/RestifyServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ protected function registerRoutes()

$this->customDefinitions($config)
->defaultRoutes($config);

}

/**
Expand All @@ -53,7 +52,7 @@ public function customDefinitions($config)
$config['prefix'] = Restify::path($repository::$prefix);

Route::group($config, function () {
$this->loadRoutesFrom(__DIR__ . '/../routes/api.php');
$this->loadRoutesFrom(__DIR__.'/../routes/api.php');
});
});

Expand All @@ -67,7 +66,7 @@ public function customDefinitions($config)
public function defaultRoutes($config)
{
Route::group($config, function () {
$this->loadRoutesFrom(__DIR__ . '/../routes/api.php');
$this->loadRoutesFrom(__DIR__.'/../routes/api.php');
});

return $this;
Expand Down