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/HasTableAlias.php

<?php

namespace Staudenmeir\EloquentHasManyDeep;

use Illuminate\Support\Str;

trait HasTableAlias
{
    /**
     * Qualify the given column name by the model's table.
     *
     * @param string $column
     * @return string
     */
    public function qualifyColumn($column)
    {
        if (Str::contains($column, '.')) {
            return $column;
        }

        $table = $this->getTable();

        if (Str::contains($table, ' as ')) {
            $table = explode(' as ', $table)[1];
        }

        return $table.'.'.$column;
    }

    /**
     * Set an alias for the model's table.
     *
     * @param string $alias
     * @return $this
     */
    public function setAlias($alias)
    {
        return $this->setTable($this->getTable().' as '.$alias);
    }
}
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