Media

You can configure where your media get stored through the storage driver of Laravel.
Configuring the storage driver is easy, and you can read more about it here

Types

Default Daalder is seeded with the following media types:

  • Image
  • Video
  • Audio
  • File

Thumbnail generation

In the media config file you can specify the thumbnails that should be generated when an image is uploaded. An example of such configuration can be seen below:

'product'    => [
     'thumbnail'  => ['width' => 80, 'height' => 80],
     'preview'    => ['width' => 210, 'height' => 210],
     'preview_2x' => ['width' => 420, 'height' => 420],
     'default'    => ['width' => 616, 'height' => 616],
     'default_2x' => ['width' => 1232, 'height' => 1232],
     'zoom'       => ['width' => 1920, 'height' => 1920],
     'zoom_2x'    => ['width' => 3840, 'height' => 3840],
 ],

API calls

Endpoint: /media


Endpoint Method Payload
/media POST mediaPayload



Media payload
{
    media*: file ,
    type*: string ,
    type_id*: int,
    subtype: string 
}

*required

Reference model fields:
Name Type Remarks
src string(250) Full url for example: https://s3.amazonaws.com/images/c6ec3d643fccfc7d1f24b6c62a8ea852/616-616_464074_original.jpeg
hash string(250) Unique hash that's generated for every image you upload, Daalder uses this to check if you have uploaded the same image already.
type_id int(11)
position tinyint(4)
metadata JSON
parent_id int(11)
updated_at date
created_at date
deleted_at date

* is required.

© 2021 Daalder. All rights reserved.