Skip to content

Commit

Permalink
Merge f30140b into 32377c2
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Feb 8, 2019
2 parents 32377c2 + f30140b commit 20481cd
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 20 deletions.
1 change: 0 additions & 1 deletion config/web-tinker.php
Expand Up @@ -12,7 +12,6 @@
*/
'dark_theme' => false,


/*
* By default this package will only run in local development.
* Do not change this, unless you know what your are doing.
Expand Down
2 changes: 1 addition & 1 deletion src/Console/InstallCommand.php
Expand Up @@ -2,8 +2,8 @@

namespace Spatie\WebTinker\Console;

use Illuminate\Console\DetectsApplicationNamespace;
use Illuminate\Console\Command;
use Illuminate\Console\DetectsApplicationNamespace;

class InstallCommand extends Command
{
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/WebTinkerController.php
Expand Up @@ -20,4 +20,4 @@ public function execute(Request $request)

return Tinker::execute($validated['code']);
}
}
}
14 changes: 7 additions & 7 deletions src/Tinker.php
Expand Up @@ -2,13 +2,13 @@

namespace Spatie\WebTinker;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Application;
use Illuminate\Support\Collection;
use Laravel\Tinker\ClassAliasAutoloader;
use Psy\Shell;
use Psy\Configuration;
use Psy\ExecutionLoopClosure;
use Psy\Shell;
use Illuminate\Support\Collection;
use Illuminate\Foundation\Application;
use Illuminate\Database\Eloquent\Model;
use Laravel\Tinker\ClassAliasAutoloader;
use Symfony\Component\Console\Output\BufferedOutput;

class Tinker
Expand Down Expand Up @@ -51,7 +51,7 @@ protected function createShell(BufferedOutput $output): Shell
$config->getPresenter()->addCasters([
Collection::class => 'Laravel\Tinker\TinkerCaster::castCollection',
Model::class => 'Laravel\Tinker\TinkerCaster::castModel',
Application::class => 'Laravel\Tinker\TinkerCaster::castApplication'
Application::class => 'Laravel\Tinker\TinkerCaster::castApplication',
]);

$shell = new Shell($config);
Expand All @@ -73,4 +73,4 @@ protected function cleanOutput(string $output): string

return trim($output);
}
}
}
10 changes: 5 additions & 5 deletions src/WebTinkerServiceProvider.php
Expand Up @@ -6,28 +6,28 @@
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Spatie\WebTinker\Console\InstallCommand;
use Spatie\WebTinker\Http\Controllers\WebTinkerController;
use Spatie\WebTinker\Http\Middleware\Authorize;
use Spatie\WebTinker\Http\Controllers\WebTinkerController;

class WebTinkerServiceProvider extends ServiceProvider
{
public function boot()
{
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/../config/web-tinker.php' => config_path('web-tinker.php'),
__DIR__.'/../config/web-tinker.php' => config_path('web-tinker.php'),
], 'config');

$this->publishes([
__DIR__ . '/../resources/views' => base_path('resources/views/vendor/web-tinker'),
__DIR__.'/../resources/views' => base_path('resources/views/vendor/web-tinker'),
], 'views');

$this->publishes([
__DIR__.'/../public' => public_path('vendor/web-tinker'),
], 'web-tinker-assets');
}

$this->loadViewsFrom(__DIR__ . '/../resources/views', 'web-tinker');
$this->loadViewsFrom(__DIR__.'/../resources/views', 'web-tinker');

$this
->registerRoutes()
Expand All @@ -36,7 +36,7 @@ public function boot()

public function register()
{
$this->mergeConfigFrom(__DIR__ . '/../config/web-tinker.php', 'web-tinker');
$this->mergeConfigFrom(__DIR__.'/../config/web-tinker.php', 'web-tinker');

$this->commands(InstallCommand::class);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/AuthorizeTest.php
Expand Up @@ -14,11 +14,11 @@ public function setUp()

config()->set('web-tinker.enabled', true);

app()->detectEnvironment(function() {
app()->detectEnvironment(function () {
return 'local';
});

Route::get('/test', function() {
Route::get('/test', function () {
return 'ok';
})->middleware(Authorize::class);
}
Expand All @@ -32,7 +32,7 @@ public function it_will_allow_requests_if_it_is_enabled()
/** @test */
public function it_will_not_allow_requests_if_the_gate_does_not_allow_it()
{
Gate::define('viewWebTinker', function() {
Gate::define('viewWebTinker', function () {
return false;
});

Expand All @@ -42,7 +42,7 @@ public function it_will_not_allow_requests_if_the_gate_does_not_allow_it()
/** @test */
public function it_will_not_allow_requests_if_it_is_disabled_even_it_the_gate_allows_it()
{
Gate::define('viewWebTinker', function() {
Gate::define('viewWebTinker', function () {
return true;
});

Expand Down
2 changes: 1 addition & 1 deletion tests/TestCase.php
Expand Up @@ -2,8 +2,8 @@

namespace Spatie\WebTinker\Tests;

use Orchestra\Testbench\TestCase as OrchestraTest;
use Spatie\WebTinker\WebTinkerServiceProvider;
use Orchestra\Testbench\TestCase as OrchestraTest;

class TestCase extends OrchestraTest
{
Expand Down

0 comments on commit 20481cd

Please sign in to comment.