Import
class Import
Properties
protectedstring | $path | Path to the directory with the import files. |
Methods
Create a new instance.
Check if this import matches to the given import files.
Check if the files of this import are valid.
The files expected by this import.
Get the basename of each file of this import.
Validate a file of this import.
Validates a JSON file to contain an array of objects, each of which has all the expected keys.
Validates a CSV file to contain the expected columns.
Read a JSON file containing an array and wrap it in a Laravel collection.
Details
at line23
__construct(string$path)
Create a new instance.
at line33
bool
filesMatch()
Check if this import matches to the given import files.
at line48
validateFiles()
Check if the files of this import are valid.
at line60
protectedarray
expectedFiles()
The files expected by this import.
at line70
protectedarray
files()
Get the basename of each file of this import.
at line84
protected
validateFile(string$basename)
Validate a file of this import.
at line98
protected
expectKeysInJson(string$file,array$expectation,bool$array =true)
Validates a JSON file to contain an array of objects, each of which has all the expected keys.
at line124
protected
expectColumnsInCsv(string$file,array$expectation)
Validates a CSV file to contain the expected columns.
at line148
protectedCollection
collectJson(string$file)
Read a JSON file containing an array and wrap it in a Laravel collection.