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.
 
 
 

38 lines
784 B

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Str;
class BodyStat extends Model
{
//
protected $fillable = ["*"];
/**
* Get an attribute from the model.
*
* @param string $key
* @return mixed
*/
public function getAttribute($key)
{
if (array_key_exists($key, $this->relations)) {
return parent::getAttribute($key);
} else {
return parent::getAttribute(Str::snake($key));
}
}
/**
* Set a given attribute on the model.
*
* @param string $key
* @param mixed $value
* @return mixed
*/
public function setAttribute($key, $value)
{
return parent::setAttribute(Str::snake($key), $value);
}
}