This repository has been archived by the owner on Apr 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ignore non creation fields fix issue with belongsTo fields
- Loading branch information
Showing
5 changed files
with
93 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Sparclex\NovaImportCard; | ||
|
||
use Laravel\Nova\Http\Requests\NovaRequest; | ||
|
||
class ImportNovaRequest extends NovaRequest | ||
{ | ||
protected $data; | ||
|
||
public function __construct($data) | ||
{ | ||
parent::__construct(); | ||
$this->data = $data; | ||
} | ||
|
||
/** | ||
* Retrieve an input item from the request. | ||
* | ||
* @param string|null $key | ||
* @param string|array|null $default | ||
* @return string|array|null | ||
*/ | ||
public function input($key = null, $default = null) | ||
{ | ||
if (!$key) { | ||
return $this->data; | ||
} | ||
if (!isset($this->data[$key])) { | ||
return $default; | ||
} | ||
return $this->data[$key]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
return [ | ||
/** | ||
* A file reader converts a type of file (xml, csv, xlsx..) to an array | ||
* | ||
* This is the default file reader used, when there is no static variable $importFileReader | ||
* present in the resource class | ||
*/ | ||
'file_reader' => Sparclex\NovaImportCard\CsvFileReader::class, | ||
|
||
/** | ||
* An import handler stores the output of the file reader into the database | ||
* | ||
* This is the default import handler used, when there is no static variable $importHandler | ||
* present in the resource class | ||
*/ | ||
'import_handler' => Sparclex\NovaImportCard\ImportHandler::class | ||
]; |