/
home
/
henzagold
/
server
/
app
/
Models
/
File Upload :
llllll
Current File: /home/henzagold/server/app/Models/ConfigStatic.php
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Intervention\Image\Exception\NotFoundException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; class ConfigStatic extends Model { use HasFactory; //protected $connection = 'pgsql'; protected $table = 'config_statics'; protected $fillable = [ 'key', 'val', ]; // protected $casts = [ // 'val'=>'array' // ]; public static function getValue($key) { $record = ConfigStatic::where('key', $key)->get()->pluck('val', 'id'); if (sizeof($record) == 1) { return $record->first(); } if (sizeof($record) == 0) throw new NotFoundHttpException('Const not found'); return $record; } }
Copyright ©2k19 -
Hexid
|
Tex7ure