first upload all files
This commit is contained in:
27
Modules/Support/Eloquent/TranslationModel.php
Normal file
27
Modules/Support/Eloquent/TranslationModel.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Support\Eloquent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
abstract class TranslationModel extends Model
|
||||
{
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $timestamps = false;
|
||||
|
||||
/**
|
||||
* Perform any actions required before the model boots.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function booting()
|
||||
{
|
||||
static::addGlobalScope('locale', function ($query) {
|
||||
$query->whereIn('locale', [locale(), config('app.fallback_locale')]);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user