How can i make a relationship between two table in laravel .one table is called defaulters tables that contain all those people that have debts and the other one is called users that have those people that has access to the system.i want to relate these two tables.i have a field called debtors in users table and another called debtors in defaulters table i want those people that have debts not to access some pages when the login and those that have no debts to access those pages .how can i achieve this .please someone help me i stuck.
below is my debtors.php middleware and is working fine
public function handle($request, Closure $next) { if(auth()->user()->debtor == 0){ return redirect('home')->with('success','You can apply for the Service. You have 0 Debt Balance '); return $next($request); } return redirect('home')->with('error','You can not apply for the Service , You have 567 Debt Balance '); }
this my web.php //user roles Route::get('/home1', 'HomeController@admin')->middleware('debtors'); Route::get('/application_dashboard', 'HomeController@application_dashboard')->middleware('debtors');'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)