Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/JuanSCaicedo/Api-Ecommerce/llms.txt

Use this file to discover all available pages before exploring further.

Every file uploaded through API Ecommerce — product cover images, product gallery images, user avatars, homepage slider banners, category images, and sale receipt comprobantes — is written to Oracle Cloud Infrastructure (OCI) Object Storage. No files are stored on the application server itself. OCI Object Storage exposes an Amazon S3-compatible API. The application takes advantage of this by using the standard league/flysystem-aws-s3-v3 adapter (already declared in composer.json) mounted on a custom Flysystem disk named oci. This means no OCI-specific SDK is required: the same Storage::disk('oci') facade calls used for S3 work transparently against OCI.

OCI disk configuration

The oci disk is declared in config/filesystems.php alongside the standard local, public, and s3 disks. The key difference from a vanilla S3 disk is the explicit endpoint override (pointing to the OCI S3-compatibility endpoint) and use_path_style_endpoint set to true, which OCI requires.
// config/filesystems.php
'oci' => [
    'driver' => 's3',
    'key'    => env('OCI_ACCESS_KEY_ID'),
    'secret' => env('OCI_SECRET_ACCESS_KEY'),
    'region' => env('OCI_DEFAULT_REGION'),
    'bucket' => env('OCI_BUCKET'),
    'endpoint' => env('OCI_ENDPOINT'),
    'url'    => env('OCI_URL'),
    'use_path_style_endpoint' => true,
    'http' => [
        'verify' => env('AWS_ENDPOINT_SSL_VERIFY', true),
    ],
    'throw'  => false,
    'report' => false,
],
use_path_style_endpoint => true is mandatory for OCI because OCI’s S3-compatible API uses path-style addressing (endpoint/bucket/key) rather than subdomain-style addressing (bucket.endpoint/key).

Required credentials

Create an Amazon S3 Compatible API Key in the OCI Console under User Settings → Customer Secret Keys. OCI will generate the access key ID and secret at that point — save the secret immediately, as it cannot be retrieved again.
VariableDescriptionWhere to find it
OCI_ACCESS_KEY_IDCustomer Secret Key IDOCI Console → User → Customer Secret Keys
OCI_SECRET_ACCESS_KEYSecret paired with the key IDShown once at key creation time
OCI_DEFAULT_REGIONOCI region identifier for the bucketOCI Console → Object Storage bucket details
OCI_BUCKETName of the Object Storage bucketOCI Console → Object Storage
OCI_ENDPOINTS3-compatible namespace endpoint URLhttps://<namespace>.compat.objectstorage.<region>.oraclecloud.com
OCI_URLBase URL used by Flysystem for public URL generationSame value as OCI_ENDPOINT
Your namespace is visible in the OCI Console under Tenancy Details (top-right user menu). For example, for the sa-saopaulo-1 region:
https://axbcdefg1234.compat.objectstorage.sa-saopaulo-1.oraclecloud.com

Storage paths used

The application organises all uploads under a shared prefix (juandevops/ecommerce/public/) inside the bucket. Each resource type has its own sub-directory:
ResourceBucket pathController
Product cover & gallery imagesjuandevops/ecommerce/public/productsAdmin\Product\ProductController
Category imagesjuandevops/ecommerce/public/categoriesAdmin\Product\CategorieController
Homepage slidersjuandevops/ecommerce/public/slidersAdmin\SliderController
User avatarsjuandevops/ecommerce/public/usersAuthController
Sale receipt comprobantesjuandevops/ecommerce/public/comprobantesEcommerce\SaleController
All uploads use Storage::disk('oci')->putFile($path, $file), which assigns a random UUID filename automatically and returns the full object key. That key is persisted to the database and later resolved to a public URL.

URL generation

When an API response needs to include a publicly accessible URL for an uploaded file, the application calls:
Storage::disk('oci')->url($storedPath);
This concatenates OCI_URL, the bucket name, and the object key to produce a direct HTTPS URL to the object, for example:
https://axbcdefg1234.compat.objectstorage.sa-saopaulo-1.oraclecloud.com
  /ecommerce-assets/juandevops/ecommerce/public/products/3f7a1b2c-….jpg
Clients (the storefront SPA, mobile apps) embed these URLs directly in <img> tags. No signed-URL or redirect layer is involved — objects are served directly from OCI.

Local development fallback

During local development you can avoid OCI entirely by switching to the built-in local driver. Set the following values in your .env:
FILESYSTEM_DISK=local
Files will be written to storage/app/public/ on the local filesystem. Run php artisan storage:link once to create a symbolic link from public/storage to storage/app/public so the files are accessible over HTTP:
php artisan storage:link
Remember to switch back to FILESYSTEM_DISK=oci (or leave it unset, since oci is the intended production default) before deploying.
Bucket objects must have public read visibility for Storage::disk('oci')->url() to return directly accessible URLs. In the OCI Console, set the bucket’s Visibility to Public, or alternatively apply a pre-authenticated request (PAR) policy. Without public read access, the generated URLs will return 403 Forbidden when accessed by clients.

Build docs developers (and LLMs) love