Skip to content
Snippets Groups Projects
Commit 9bc9a877 authored by btalhaoui's avatar btalhaoui
Browse files

Fixed organizations error

parent 0ff6ac82
No related branches found
No related tags found
No related merge requests found
......@@ -26,4 +26,10 @@ class User extends Authenticatable
protected $hidden = [
'password', 'remember_token',
];
public function organizations()
{
return $this->belongsToMany('App\Models\Organizations','users_organizations', 'user_id','organization_id')
->withTimestamps();
}
}
......@@ -47,16 +47,17 @@
<li><a href="{{ route('register') }}">Register</a></li>
@else
<li class="dropdown">
<li>
<a href="org">
Organizations
</a>
</li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" aria-haspopup="true">
{{ Auth::user()->name }} <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li>
<a href="org">
Organizations
</a>
</li>
<li>
<a href="{{ route('logout') }}"
onclick="event.preventDefault();
......
......@@ -18,3 +18,5 @@ Route::get('/', function () {
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::get('/org', 'OrganizationController@index')->name('organizations');
Route::post('/org', 'OrganizationController@addOrg');
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment