forked from johndavedecano/laragym
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
18ec654
commit be9cf3a
Showing
16 changed files
with
202 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
/** | ||
* Created by PhpStorm. | ||
* User: Dave | ||
* Date: 9/15/2018 | ||
* Time: 5:48 PM | ||
*/ | ||
|
||
namespace App\Http\Middleware; | ||
|
||
|
||
use Illuminate\Auth\Access\AuthorizationException; | ||
|
||
class UserAdmin | ||
{ | ||
public function handle($request, \Closure $next) | ||
{ | ||
$user = auth()->guard()->user(); | ||
|
||
if (!$user->is_admin) { | ||
throw new AuthorizationException("You are not allowed to access resource."); | ||
} | ||
|
||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
:local(.small) { | ||
width: 50px; | ||
height: 50px; | ||
border-radius: 50%; | ||
} | ||
|
||
:local(.medium) { | ||
width: 100px; | ||
height: 100px; | ||
border-radius: 50%; | ||
} |
21 changes: 21 additions & 0 deletions
21
resources/apps/frontend/src/components/Avatar/AvatarInfo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import Avatar from './'; | ||
import {Link} from 'react-router-dom'; | ||
|
||
export default class extends React.Component { | ||
render() { | ||
return ( | ||
<Link to={`/members/${this.props.id}`}> | ||
<div className="float-left pr-2 d-flex align-items-center justify-content-end"> | ||
<Avatar src={this.props.avatar} /> | ||
</div> | ||
<div className="float-left"> | ||
{this.props.name} | ||
<div> | ||
<span className="small text-muted">{this.props.email}</span> | ||
</div> | ||
</div> | ||
</Link> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import avatar from './../../assets/avatar.jpg'; | ||
import styles from './Avatar.scss'; | ||
|
||
class Avatar extends React.Component { | ||
static defaultProps = { | ||
size: 'small', | ||
src: '', | ||
}; | ||
|
||
get src() { | ||
if (!this.props.src) return avatar; | ||
return this.props.src; | ||
} | ||
|
||
render() { | ||
return <img src={this.src} alt="" className={styles[this.props.size]} />; | ||
} | ||
} | ||
|
||
export default Avatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.