-
Notifications
You must be signed in to change notification settings - Fork 18
Source and Source Types
These get attached to the Model
And example is the app/Source/Types/WebFile.php
file.
This will get called here app/Models/Source.php:40
/**
* @throws SourceTypeMissingException
*/
public function run()
{
$statusType = $this->type->label();
try {
app("App\Source\Types\\".$statusType, [
'source' => $this,
])->handle();
} catch (\Exception $e) {
logger($e);
throw new SourceTypeMissingException();
}
}
Then it will get the file and download it.
You can put your own types in here as long as the extend the BaseSourceType
This field will be used if there are multiple sources and they need to be batched
This is cast to app/Source/SourceTypeEnum.php:5
see more below.
Encrypted array cast field to hold needing config data for the different source types
You can see the types in app/Source/SourceTypeEnum.php
Any thing in the app/Source/Types
folder can then be used as a type.
There is a meta_data
field that it is encrypted. Depending on the type will be expected fields.
This is ready to use, point it to a url with a web file and it will download it.
You can see in database/factories/SourceFactory.php:40
[
'type' => SourceTypeEnum::WebFile,
'meta_data' => [
'url' => 'https://wikipedia.com/foo.pdf',
'username' => 'foo',
'password' => 'bar',
'auth' => 'basic',
],
];
WebUpload Source that will then make a UI in LaraChain for the user to use
Simple example of getting a web page for later transformation
Get files from S3 Dir
- Get Basic Auth Setup
- Get Bearer Auth Setup