CasperSecurity

Current Path : /var/www/hrms.uiet.co.in/vendor/staudenmeir/eloquent-has-many-deep/src/
Upload File :
Current File : /var/www/hrms.uiet.co.in/vendor/staudenmeir/eloquent-has-many-deep/src/HasEagerLimit.php

<?php

namespace Staudenmeir\EloquentHasManyDeep;

use Illuminate\Database\Query\Grammars\MySqlGrammar;
use RuntimeException;

trait HasEagerLimit
{
    /**
     * Alias to set the "limit" value of the query.
     *
     * @param int $value
     * @return $this
     */
    public function take($value)
    {
        return $this->limit($value);
    }

    /**
     * Set the "limit" value of the query.
     *
     * @param int $value
     * @return $this
     */
    public function limit($value)
    {
        if ($this->farParent->exists) {
            $this->query->limit($value);
        } else {
            if (!class_exists('Staudenmeir\EloquentEagerLimit\Builder')) {
                $message = 'Please install staudenmeir/eloquent-eager-limit and add the HasEagerLimit trait as shown in the README.'; // @codeCoverageIgnore

                throw new RuntimeException($message); // @codeCoverageIgnore
            }

            $column = $this->getQualifiedFirstKeyName();

            $grammar = $this->query->getQuery()->getGrammar();

            if ($grammar instanceof MySqlGrammar && $grammar->useLegacyGroupLimit($this->query->getQuery())) {
                $column = 'laravel_through_key';
            }

            $this->query->groupLimit($value, $column);
        }

        return $this;
    }
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY