<?php


return [
    'models' => [
        'App\Models\Artist' =>
        [
            'url'             => '/api/v1/artists/',
            'title_field'     => 'name',
            'image_field'     => 'image',
            'fields'          => [
                'name',
                'description',
            ],
            'relation_fields' => [
                'collections.name',
                'tags.name'
            ]
        ],
        'App\Models\Exhibition' =>
        [
            'url'             => '/api/v1/exhibitions/',
            'title_field'     => 'name',
            'image_field'     => 'image',
            'fields'          => [
                'name',
                'description',
                'curator',
                'roomSheet.title',
                'roomSheet.subtitle',
                'roomSheet.description',
            ],
            'relation_fields' => [
                'location.name',
                'location.description',
                'location.address',
                'artists.name',
                'artists.descriptiom',
                'collections.name',
                'tags.name'
            ]
        ],
        'App\Models\NewsItem' =>
        [
            'url'             => '/api/v1/news/',
            'url_field'       => 'link', //if provided will be used for the search result url
            'title_field'     => 'title',
            'image_field'     => 'image',
            'fields'          => [
                'title',
                'description',
                'author',
            ],
            'relation_fields' => [
                'category.name',
                'artists.name',
            ]
        ],
        'App\Models\Collection' =>
        [
            'url'             => '/api/v1/collections/',
            'title_field'     => 'name',
            'image_field'     => 'image',
            'fields'          => [
                'name',
                'description',
            ],
            'relation_fields' => [
                'artists.name',
            ],
            'blockFields' => [
                'wysiwyg',
                'block_title',
            ]
        ],
        'App\Models\Location' =>
        [
            'url'             => '/api/v1/locations/',
            'title_field'     => 'name',
            'image_field'     => 'image',
            'fields'          => [
                'name',
                'description',
            ],
        ],
    ],
    'throwsReindex' => [
        'App\Models\NewsCategory' => [
            'reindexes' => [ //the relations that are reindexed when the model is saved
                'newsItems'
            ]
        ],
        'App\Models\Tag' => [
            'reindexes' => [ //the relations that are reindexed when the model is saved
                'artists',
                'exhibitions'
            ]
        ],
        'App\Models\Artist' => [
            'reindexes' => [ //the relations that are reindexed when the model is saved
                'exhibitions',
                'collections'
            ]
        ],
        'App\Models\Collection' => [
            'reindexes' => [ //the relations that are reindexed when the model is saved
                'artists',
            ]
        ],
        'App\Models\Exhibition' => [
            'reindexes' => [ //the relations that are reindexed when the model is saved
                'artists',
                'collections',
            ]
        ],
    ],
];
