海南旅游SAAS
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.

20 lines
425 B

  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Factories\HasFactory;
  4. use Illuminate\Database\Eloquent\Model;
  5. class AdminSetting extends Model
  6. {
  7. use HasFactory;
  8. public static function val($slug)
  9. {
  10. if (is_array($slug)) {
  11. return static::query()->whereIn('slug', $slug)->pluck('value')->toArray() ?? [];
  12. } else {
  13. return static::query()->where('slug', $slug)->value('value') ?? null;
  14. }
  15. }
  16. }