<commit_before><?php namespace Orchestra\Model;

use Closure;
use Illuminate\Database\Eloquent\Model;

abstract class Eloquent extends Model
{
    /**
     * Determine if the model instance uses soft deletes.
     *
     * @return bool
     */
    public function isSoftDeleting()
    {
        return (property_exists($this, 'forceDeleting') && $this->forceDeleting === false);
    }

    /**
     * Execute a Closure within a transaction.
     *
     * @param  \Closure  $callback
     *
     * @return mixed
     *
     * @throws \Throwable
     */
    public function transaction(Closure $callback)
    {
        return $this->getConnection()->transaction($callback);
    }
}<commit_msg>Add Model::transform() for simple transformer support.<commit_after><?php namespace Orchestra\Model;

use Closure;
use Illuminate\Database\Eloquent\Model;

abstract class Eloquent extends Model
{
    /**
     * Determine if the model instance uses soft deletes.
     *
     * @return bool
     */
    public function isSoftDeleting()
    {
        return (property_exists($this, 'forceDeleting') && $this->forceDeleting === false);
    }

    /**
     * Execute a Closure within a transaction.
     *
     * @param  \Closure  $callback
     *
     * @return mixed
     *
     * @throws \Throwable
     */
    public function transaction(Closure $callback)
    {
        return $this->getConnection()->transaction($callback);
    }

    /**
     * Transform each attribute in the model using a callback.
     *
     * @param  callable  $callback
     *
     * @return \Illuminate\Support\Fluent
     */
    public function transform(callable $callback)
    {
        return new Illuminate\Support\Fluent($callback($this));
    }
}
{'fraction_non_alphanumeric': 0.11395348837209303, 'fraction_numerical': 0.0, 'mean_word_length': 2.4558232931726907, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '1152456', 'n_tokens_mistral': 506, 'n_tokens_neox': 497, 'n_words': 124}