for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Settings module model
*
* Model for module Settings
* @category Model
* @subpackage Admin
* @package Olapus
* @author Jan Drda <[email protected]>
* @copyright Jan Drda
* @license https://opensource.org/licenses/MIT MIT
*/
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Settings extends Model
{
use SoftDeletes, AdminModelTrait;
* Get settings by name
* @param $name
* @return |null
|null
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.
public static function getByName($name){
$result = self::where('name', $name)->first();
if(!empty($result)){
return $result->value;
}
else{
return null;
* The database table used by the model.
* @var string
protected $table = 'settings';
* The attributes that should be mutated to dates.
* @var array
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
* The attributes that are mass assignable.
protected $fillable = ['name', 'value', 'description'];
* Columns to exclude from index
protected $excludedFromIndex = [];
* Fields to search in fulltext mode
protected $fulltextFields = [
'id',
'name' => [
'operator' => 'LIKE',
'prefix' => '%',
'sufix' => '%'
],
'value' => [
'description' => [
];
* Default order by
protected $defaultOrderBy = [
'name' => 'asc'
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.