edit: i miss read the queation. will edit properly later.
assuming those relationships are in the models, and you are actually passing the value to the database via say a form, make sure to set all the attributes that are mass assignable in the models like :
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Student extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name',
'dob',
'student_fees'
];
/**
* Get the fees for the student.
*/
public function fees()
{
return $this->hasMany('App\Fees');
}
}
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Fees extends Model
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'payment_method',
'bank_name',
'account_no',
'balance',
'amount',
'date'
];
/**
* Get the student the fees belongs to.
*/
public function student()
{
return $this->belongsTo('App\Student');
}
}
reference https://laravel.com/docs/5.4/eloquent#mass-assignment
also,
$table->unsignedInteger('student_id')->unsigned();
should be
$table->integer('student_id')->unsigned();