AriasBros /
eloquent-locale
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Locale\Models; |
||
| 4 | |||
| 5 | use Illuminate\Database\Eloquent\Model; |
||
| 6 | use Illuminate\Database\Eloquent\Relations\Pivot; |
||
| 7 | use Illuminate\Database\Query\Builder; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Class Locale |
||
| 11 | * |
||
| 12 | * @since 1.0.0 |
||
| 13 | * @package Locale\Models |
||
| 14 | * |
||
| 15 | * @method static Builder create(array $attributes) |
||
| 16 | * @method static Locale find(string $id) |
||
| 17 | * @method static Builder whereKey(string $id) |
||
| 18 | * |
||
| 19 | * @property integer id |
||
| 20 | * @property string name |
||
| 21 | * @property Pivot translation |
||
| 22 | */ |
||
| 23 | class Locale extends Model |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * The "type" of the auto-incrementing ID. |
||
| 27 | * |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected $keyType = 'string'; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Indicates if the IDs are auto-incrementing. |
||
| 34 | * |
||
| 35 | * @var bool |
||
| 36 | */ |
||
| 37 | public $incrementing = false; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * The attributes that aren't mass assignable. |
||
| 41 | * |
||
| 42 | * @since 1.0.0 |
||
| 43 | * @var array |
||
| 44 | */ |
||
| 45 | protected $guarded = []; |
||
| 46 | |||
| 47 | /** |
||
| 48 | * @since 1.0.0 |
||
| 49 | * @return Locale |
||
| 50 | */ |
||
| 51 | public static function current() |
||
| 52 | { |
||
| 53 | return Locale::find(app()->getLocale()); |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 54 | } |
||
| 55 | } |
||
| 56 |