<commit_before><?php

namespace Laravel\Shop;

use Eloquent\ImageAble\ImageAble;
use Eloquent\ImageAble\ImageAbleTrait;
use Eloquent\Meta\MetaAble;
use Eloquent\Meta\MetaTrait;
use Eloquent\Sortable\Sortable;
use Eloquent\Sortable\SortableTrait;
use Eloquent\Translatable\Translatable;
use Eloquent\Translatable\TranslatableTrait;
use Flysap\Scaffold\ScaffoldAble;
use Flysap\Scaffold\Traits\ScaffoldTrait;
use Illuminate\Database\Eloquent\Model;
use Laravel\Meta\Eloquent\MetaSeoable;
use Laravel\Meta\Eloquent\MetaSeoTrait;
use Laravel\Relations\RelationTrait;
use Parfumix\FormBuilder as Form;

class Product extends Model implements ImageAble, Translatable, MetaAble, MetaSeoable, Sortable, ScaffoldAble {

    use ImageAbleTrait, TranslatableTrait, MetaTrait, MetaSeoTrait, SortableTrait, ScaffoldTrait, RelationTrait;

    /**
     * @var array
     */
    protected $translatedAttributes = [
        'title',
        'description'
    ];

    protected $translationClass = ProductTranslation::class;

    /**
     * @var string
     */
    protected $table = 'products';

    /**
     * @var bool
     */
    public $timestamps = false;

    /**
     * @var array
     */
    public $fillable = ['price', 'active'];

    /**
     * @return array
     */
    public function skyShow() {
        $eloquent = $this;

        return ['id', 'title', 'description', 'image' => ['closure' => function($value, $elements) use($eloquent) {
            $id = $elements['elements']['id'];

            $image = $eloquent->where('id', $id)->first()->images()->orderBy('id', 'desc')->first();

            if( $image )
                return $image->present()->render(['width' => '200px']);

            return $value;
        }]];
    }


}<commit_msg>return list of widgets for current page.<commit_after><?php

namespace Laravel\Shop;

use Eloquent\ImageAble\ImageAble;
use Eloquent\ImageAble\ImageAbleTrait;
use Eloquent\Meta\MetaAble;
use Eloquent\Meta\MetaTrait;
use Eloquent\Sortable\Sortable;
use Eloquent\Sortable\SortableTrait;
use Eloquent\Translatable\Translatable;
use Eloquent\Translatable\TranslatableTrait;
use Flysap\Scaffold\ScaffoldAble;
use Flysap\Scaffold\Traits\ScaffoldTrait;
use Illuminate\Database\Eloquent\Model;
use Laravel\Meta\Eloquent\MetaSeoable;
use Laravel\Meta\Eloquent\MetaSeoTrait;
use Laravel\Relations\RelationTrait;
use Parfumix\FormBuilder as Form;

class Product extends Model implements ImageAble, Translatable, MetaAble, MetaSeoable, Sortable, ScaffoldAble {

    use ImageAbleTrait, TranslatableTrait, MetaTrait, MetaSeoTrait, SortableTrait, ScaffoldTrait, RelationTrait;

    /**
     * @var array
     */
    protected $translatedAttributes = [
        'title',
        'description'
    ];

    protected $translationClass = ProductTranslation::class;

    /**
     * @var string
     */
    protected $table = 'products';

    /**
     * @var bool
     */
    public $timestamps = false;

    /**
     * @var array
     */
    public $fillable = ['price', 'active'];

    /**
     * @return array
     */
    public function skyShow() {
        $eloquent = $this;

        return ['id', 'title', 'description', 'image' => ['closure' => function($value, $elements) use($eloquent) {
            $id = $elements['elements']['id'];

            $image = $eloquent->where('id', $id)->first()->images()->orderBy('id', 'desc')->first();

            if( $image )
                return $image->present()->render(['width' => '200px']);

            return $value;
        }]];
    }

    /**
     * Return lists of widgets for current page .
     *
     * @return array
     */
    public function widgets() {
        return [''];
    }


}
{'fraction_non_alphanumeric': 0.13885107541519195, 'fraction_numerical': 0.0016335420637081405, 'mean_word_length': 3.0285087719298245, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4762506', 'n_tokens_mistral': 1238, 'n_tokens_neox': 1196, 'n_words': 235}