Skip to content

Commit

Permalink
Widen type hint
Browse files Browse the repository at this point in the history
Fixes #8 (and possibly #7 ?)
  • Loading branch information
simonhamp committed May 15, 2019
1 parent c3f390f commit 89f2f85
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/Http/Controllers/ImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

namespace SimonHamp\LaravelNovaCsvImport\Http\Controllers;

use App\Nova\Resource;
use Illuminate\Database\QueryException;
use Laravel\Nova\Nova;
use Laravel\Nova\Resource;
use Laravel\Nova\Rules\Relatable;
use Laravel\Nova\Resource as NovaResource;
use Laravel\Nova\Http\Requests\NovaRequest;
use SimonHamp\LaravelNovaCsvImport\Importer;
use Illuminate\Validation\ValidationException;
use SimonHamp\LaravelNovaCsvImport\ImportException;
use Maatwebsite\Excel\Exceptions\NoTypeDetectedException;

class ImportController
{
Expand Down Expand Up @@ -82,7 +78,7 @@ public function import(NovaRequest $request, $file)
return response()->json(['result' => 'success']);
}

protected function extractValidationRules($request, NovaResource $resource)
protected function extractValidationRules($request, Resource $resource)
{
return collect($resource::rulesForCreation($request))->mapWithKeys(function ($rule, $key) {
foreach ($rule as $i => $r) {
Expand Down

3 comments on commit 89f2f85

@stiknoltz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey Simon, it looks like line 48 where the error originally occurs wasn’t updated. So the issue would likely persist.

@simonhamp
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn’t need to update that line as the imports have changed instead to align more with your goal. Please try updating and testing :)

@stiknoltz
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see the change to line 6.

I can confirm that this is working now.

Thanks!

Please sign in to comment.