Navigation Menu

Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored and StyleCIBot committed Aug 24, 2018
1 parent 616d8fa commit c769a7a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion routes/api.php
Expand Up @@ -3,4 +3,4 @@

use Illuminate\Support\Facades\Route;

Route::get('/', \Spatie\TagsField\Http\Controllers\TagsFieldController::class . '@index');
Route::get('/', \Spatie\TagsField\Http\Controllers\TagsFieldController::class.'@index');
2 changes: 0 additions & 2 deletions src/Http/Controllers/TagsFieldController.php
Expand Up @@ -2,8 +2,6 @@

namespace Spatie\TagsField\Http\Controllers;

use Illuminate\Http\Request;
use Spatie\TagsField\File;
use Illuminate\Routing\Controller;

class TagsFieldController extends Controller
Expand Down
6 changes: 2 additions & 4 deletions src/Http/Middleware/Authorize.php
Expand Up @@ -3,9 +3,8 @@
namespace Spatie\TagsField\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Spatie\TagsField\Tags;
use Spatie\TagsField\Tool;
use Illuminate\Http\Request;
use Symfony\Component\HttpFoundation\Response;

class Authorize
Expand All @@ -14,11 +13,10 @@ public function handle(Request $request, Closure $next): Response
{
//TODO: see if this is necessary


return $next($request);

return app(Tags::class)->authorize($request)
? $next($request)
: abort(403);
}
}
}
4 changes: 2 additions & 2 deletions src/Tags.php
Expand Up @@ -2,9 +2,9 @@

namespace Spatie\TagsField;

use Spatie\Tags\Tag;
use Laravel\Nova\Fields\Field;
use Laravel\Nova\Http\Requests\NovaRequest;
use Spatie\Tags\Tag;

class Tags extends Field
{
Expand All @@ -21,7 +21,7 @@ protected function fillAttributeFromRequest(NovaRequest $request, $requestAttrib

public function resolveAttribute($resource, $attribute = null)
{
return $resource->tags->map(function(Tag $tag) {
return $resource->tags->map(function (Tag $tag) {
return ['id' => $tag->id, 'name' => $tag->name];
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/TagsFieldServiceProvider.php
Expand Up @@ -2,9 +2,9 @@

namespace Spatie\TagsField;

use Illuminate\Support\Facades\Route;
use Laravel\Nova\Nova;
use Laravel\Nova\Events\ServingNova;
use Illuminate\Support\Facades\Route;
use Illuminate\Support\ServiceProvider;
use Spatie\TagsField\Http\Middleware\Authorize;

Expand Down
4 changes: 0 additions & 4 deletions tests/ToolControllerTest.php
Expand Up @@ -2,10 +2,6 @@

namespace Spatie\TagsField\Tests;

use Spatie\TagsField\Http\Controllers\TagsFieldController;
use Spatie\TagsField\TagsField;
use Symfony\Component\HttpFoundation\Response;

class ToolControllerTest extends TestCase
{
/** @test */
Expand Down

0 comments on commit c769a7a

Please sign in to comment.