Skip to content

Configuration

Overview

Configuration for Pyle is separated into individual files under config/pyle. You can either override the different config options adhoc or you can publish all the configuration options and tweak as you see fit.

bash
php artisan vendor:publish --tag=pyle

Database Table Prefix

pyle/database.php

So that Pyle tables do not conflict with your existing application database tables, you can specify a prefix to use. If you change this after installation, you are on your own - happy renaming!

php
    'table_prefix' => 'pyle_',

Database Connection

pyle/database.php

By default, the package uses the default database connection defined in Laravel. Here specify a custom database connection for Pyle.

php
'connection' => 'some_custom_connection',

If you are using a custom database connection that is not the default connection in your Laravel configuration, you need to specify it in the .env file as well.

ACTIVITY_LOGGER_DB_CONNECTION=some_custom_connection

In our package, we utilize Spatie's laravel-activitylog for logging. The mentioned configuration allows the activity logger to use a different database connection instead of the default database connection.

Orders

pyle/orders.php

Here you can set up the statuses you wish to use for your orders.

php
'draft_status' => 'awaiting-payment',
'statuses' => [
    'awaiting-payment' => [
        'label' => 'Awaiting Payment',
        'color' => '#848a8c',
    ],
    'payment-received' => [
        'label' => 'Payment Received',
        'color' => '#6a67ce',
    ],
],

Media

pyle/media.php

Transformations for all uploaded images.

php
'transformations' => [
    'zoom' => [
        'width' => 500,
        'height' => 500,
    ],
    'large' => [
        // ...
    ],
    'medium' => [
        // ...
    ],
    'small' => [
        // ...
    ],
],

Products

pyle-admin/products.php

php
'disable_variants' => false,
'sku' => [
    'required' => true,
    'unique'   => true,
],
'gtin' => [
    'required' => false,
    'unique'   => false,
],
'mpn' => [
    'required' => false,
    'unique'   => false,
],
'ean' => [
    'required' => false,
    'unique'   => false,
],

Data Feeds

config/pyle.php

Defines the Laravel disk used to store files downloaded by data feed connectors such as the HTTP File connector.

php
'datafeed_disk' => env('DATAFEED_DISK', 's3'),
KeyDefaultPurpose
datafeed_disks3The filesystem disk (defined in config/filesystems.php) where data feed files are stored after download.

Set DATAFEED_DISK in your .env file to override the default:

DATAFEED_DISK=local

Model Overrides

config/pyle.php

Registers application model overrides that the manifest resolves at boot time. Each key is either the framework contract class or the framework model class; the value is the application class that should be used in its place.

php
'overrides' => [
    'models' => [
        \CBOX\Framework\Models\Contracts\Order::class => \App\Models\Order::class,
    ],
],

Convention-based overrides (an App\Models\X that extends CBOX\Framework\Models\X) are discovered automatically and do not require an entry here. See Extending Models for the full registration guide.

Pricing

pyle/pricing.php

If you want to store pricing inclusive of tax then set this config value to true.

php
'stored_inclusive_of_tax' => false,