I have 2 tables, Users and Statements. I need to display monthly statements for the currently logged user.
User Model
public function statements()
{
return $this->hasMany('\App\Models\Statement','account_number','name');
}
Statement Model
protected $primaryKey = 'account_number';
public $incrementing = false;
protected $keyType = 'string';
public function user()
{
return $this->belongsTo('\App\Models\User','account_number','name');
}
User Tabe
id
name // (ex: 01-234567 and used as username for login)
accname
email
password
Statement Table
id
account_number
month
bill
due
How can I display the monthly data in a datatable and also the current month data in a separate div in my blade file.
I'm new to laravel so kindly guide me.
Thank you in advance