<commit_before><?php

namespace LaravelFlare\Flare\Admin\Widgets;

use LaravelFlare\Flare\Admin\Models\ManagedModel;

class DefaultWidget extends WidgetAdmin
{
    /**
     * The Module Admin Default View.
     *
     * @var string
     */
    protected static $view = 'flare::admin.widgets.default';

    /**
     * Background colour options.
     *
     * @var array
     */
    protected $bgColours = ['light-blue', 'aqua', 'green', 'yellow', 'red', 'navy', 'teal', 'purple', 'orange', 'maroon'];

    /**
     * Counter.
     *
     * Determines which $bgColour index to use next
     *
     * @var int
     */
    protected static $counter = 0;

    /**
     * __construct.
     *
     * @param ManagedModel $managedModel
     */
    public function __construct(ManagedModel $managedModel)
    {
        if (!$managedModel) {
            return;
        }

        if (self::$counter == 10) {
            self::$counter = 0;
        }

        $this->viewData['bgColour'] = $this->bgColours[self::$counter];
        $this->viewData['pluralTitle'] = $managedModel::pluralTitle();
        $this->viewData['modelTotal'] = $managedModel->model->count();
        $this->viewData['icon'] = $managedModel::$icon;

        ++self::$counter;
    }
}<commit_msg>Fix to DefaultWidget (another to come)<commit_after><?php

namespace LaravelFlare\Flare\Admin\Widgets;

use LaravelFlare\Flare\Admin\Models\ModelAdmin;

class DefaultWidget extends WidgetAdmin
{
    /**
     * The Module Admin Default View.
     *
     * @var string
     */
    protected static $view = 'flare::admin.widgets.default';

    /**
     * Background colour options.
     *
     * @var array
     */
    protected $bgColours = ['light-blue', 'aqua', 'green', 'yellow', 'red', 'navy', 'teal', 'purple', 'orange', 'maroon'];

    /**
     * Counter.
     *
     * Determines which $bgColour index to use next
     *
     * @var int
     */
    protected static $counter = 0;

    /**
     * __construct.
     *
     * @param ModelAdmin $modelAdmin
     */
    public function __construct(ModelAdmin $modelAdmin)
    {
        if (!$modelAdmin) {
            return;
        }

        if (self::$counter == 10) {
            self::$counter = 0;
        }

        /**
         * Remove this from the __construct, it breaks migrations.
         */
        $this->viewData['bgColour'] = $this->bgColours[self::$counter];
        $this->viewData['pluralTitle'] = $modelAdmin::pluralTitle();
        $this->viewData['modelTotal'] = $modelAdmin->model()->count();
        $this->viewData['icon'] = $modelAdmin::$icon;

        ++self::$counter;
    }
}
{'fraction_non_alphanumeric': 0.1568477429227238, 'fraction_numerical': 0.00306044376434583, 'mean_word_length': 2.260598503740648, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2481506', 'n_tokens_mistral': 819, 'n_tokens_neox': 800, 'n_words': 165}