public function getUser() { $responseData = \Auth::user()->toArray(); $responseData['pingBaseUrl'] = \App\Ping::baseUrl(); $responseData['avatar'] = \Gravatar::get($responseData['email']); unset($responseData['id']); unset($responseData['updated_at']); return response($responseData, 200); }
.container { text-align: center; display: table-cell; vertical-align: middle; } .content { text-align: center; display: inline-block; } .title { font-size: 96px; } </style> </head> <body> <div class="container"> <div class="content"> <img src="<?php echo Gravatar::get('*****@*****.**'); ?> " alt="" /> <div class="title">Laravel 5</div> </div> </div> </body> </html>
@if (empty($data['image'])) <img src="<?php echo Gravatar::get($data['email']); ?> " alt=""/> @else <img src="<?php echo '/uploads/' . $data['image']; ?> " alt=""/> @endif <p>First name : {{$data['first_name']}}</p> <p>Last name : {{$data['last_name']}}</p> <p>Email : {{$data['email']}}</p> <a href="auth/logout">Logout</a>
<?php /* |-------------------------------------------------------------------------- | Application Routes |-------------------------------------------------------------------------- | | Here is where you can register all of the routes for an application. | It's a breeze. Simply tell Laravel the URIs it should respond to | and give it the controller to call when that URI is requested. | */ Route::get('/', function () { return view('welcome'); }); Route::get('/home', function () { return 'Welcome Home!'; }); Route::get('/phone', function () { return Response::view('smartphone', ['smartPhone' => app('SmartPhone')]); }); Route::get('/gravatar', function () { return Response::view('gravatar', ['image' => Gravatar::get('*****@*****.**')]); }); Route::get('/shorten', function () { var_dump(Bitly::shorten('http://academy.binary-studio.com/#/user/hometaskinfo?id=5592d539c200e4d84feb2863')); });