datatable.directory codebase
				https://datatable.directory/
			
			
		
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							36 lines
						
					
					
						
							763 B
						
					
					
				
			
		
		
	
	
							36 lines
						
					
					
						
							763 B
						
					
					
				<?php
 | 
						|
 | 
						|
 | 
						|
namespace App\Models;
 | 
						|
 | 
						|
 | 
						|
use Illuminate\Database\Eloquent\Model;
 | 
						|
 | 
						|
class BaseModel extends Model
 | 
						|
{
 | 
						|
    public function getAttribute($key)
 | 
						|
    {
 | 
						|
        if ($this->exists && ! $key) {
 | 
						|
            throw new \LogicException("No attribute ".var_export($key, true));
 | 
						|
        }
 | 
						|
 | 
						|
        return parent::getAttribute($key);
 | 
						|
    }
 | 
						|
 | 
						|
    /**
 | 
						|
     * Get a relationship.
 | 
						|
     *
 | 
						|
     * @param  string  $key
 | 
						|
     * @return mixed
 | 
						|
     */
 | 
						|
    public function getRelationValue($key)
 | 
						|
    {
 | 
						|
        if ($this->exists && !method_exists($this, $key)) {
 | 
						|
            if (!isset($this->original[$key])) {
 | 
						|
                throw new \LogicException("No attribute or relation " . var_export($key, true));
 | 
						|
            }
 | 
						|
        }
 | 
						|
 | 
						|
        return parent::getRelationValue($key);
 | 
						|
    }
 | 
						|
}
 | 
						|
 |