<commit_before><?php

namespace Plank\Mediable;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\MorphToMany;

/**
 * Mediable Trait.
 *
 * Provides functionality for attaching media to an eloquent model.
 *
 * @author <NAME> <<EMAIL>>
 * @var bool
 * Whether the model should automatically reload its media relationship after modification.
 */
trait Mediable
{
    /**
     * List of media tags that have been modified since last load.
     * @var array
     */
    private $media_dirty_tags = [];

    /**
     * Relationship for all attached media.
     * @return \Illuminate\Database\Eloquent\Relations\MorphToMany
     */
    public function media()
    {
        return $this->morphToMany(Media::class, 'mediable')->withPivot('tag');
    }<commit_msg>Link mediable to possibly custom object based on the config value.<commit_after><?php

namespace Plank\Mediable;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\MorphToMany;

/**
 * Mediable Trait.
 *
 * Provides functionality for attaching media to an eloquent model.
 *
 * @author <NAME> <<EMAIL>>
 * @var bool
 * Whether the model should automatically reload its media relationship after modification.
 */
trait Mediable
{
    /**
     * List of media tags that have been modified since last load.
     * @var array
     */
    private $media_dirty_tags = [];

    /**
     * Relationship for all attached media.
     * @return \Illuminate\Database\Eloquent\Relations\MorphToMany
     */
    public function media()
    {
        return $this->morphToMany(config('mediable.model'), 'mediable')->withPivot('tag');
    }
{'fraction_non_alphanumeric': 0.11010284331518451, 'fraction_numerical': 0.0, 'mean_word_length': 3.318537859007833, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, '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': '7010794', 'n_tokens_mistral': 485, 'n_tokens_neox': 483, 'n_words': 138}