Hmm, weird. Will have to see if my local MariaDB database settings are the issue @snapey . Still getting only the first row.
@janosk the migrations just ran fine. Will also have to see if migrations after cause the two second lines / roles to be removed. Must be overlooking something here.
<?php
namespace App\Models\Auth;
use Illuminate\Database\Eloquent\Model;
class Role extends Model
{
public $timestamps = false;
public function users()
{
return $this->hasMany(User::class);
}
}
as well as a user model under our Models/Auth directory. In User.php we connect things between roles and the users as well using:
/**
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function role()
{
return $this->belongsTo(Role::class);
}
besides other things like user groups.
Anyways, the issue is that somehow migrations do not always run properly - not all roles added to roles table - though there are no errors. Even ran php migrate -vvv but nothing useful showed up when only one role was added.
stop giving rubbish advice please... his original problem has NOTHING to do with relationship - he isnt USING that to insert data.
I suggest you go back and learn laravel and its basics learn what the people are saying check your answer with someone in your team before u post an answer..
otherwise you annoy people and people will just ignore you!