change language id to uuid

This commit is contained in:
Milos Holba
2021-02-09 16:22:06 +01:00
parent a8457cf261
commit 29fce75d35
7 changed files with 121 additions and 20 deletions
+14 -1
View File
@@ -3,14 +3,27 @@
namespace App;
use App\LanguageString;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Model;
class Language extends Model
{
public $timestamps = false;
protected $guarded = ['id'];
protected $keyType = 'string';
public $incrementing = false ;
public $timestamps = false;
protected static function booted()
{
static::creating(function($model) {
$model->id = Str::uuid();
});
}
public function languegeStrings()
{
return $this->hasMany('App\LanguageString', 'language_id', 'id');