<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @property int $id
 * @property string $language
 * @property string $message
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages whereLanguage($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages whereMessage($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|TickerMessages whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class TickerMessages extends Model
{
    //
    protected $table = 'ticker_messages';

    protected $fillable = ['language', 'message'];

    public static function getMessages($language){
        return self::where('language', $language)->orderBy('updated_at', 'desc');
    }


}
