I want to display the profile page for my project on laravel but this error is killing me, i tried everything but stuck here, please help me ASAP.
here is profile.blade php file
@extends('layouts.app2')
@section('title', 'Profile')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<img src="uploads/profile/" style="width: 150px; height: 150px; float: left; border-radius: 50%;margin-right: 25px;">
<h2>'s Profile</h2>
<form enctype="multipart/form-data" action="/profile" method="POST">
<?php echo csrf_field(); ?>
Upload your photo<input type="file" name="avatar">
<input type="submit" name="submit" class="pull-right btn btn-sm btn-primary">
</form>
</div>
<div class="panel-heading"><H1><b>YourPosts</b></H1></div><hr>
<div class="panel-body">
<?php
$user=$user;
echo'<h1>Lost Post </h1>';
$losts= $user->lost;
echo'<table width="100%" cellpadding="0" cellspacing="0" border="1" align="center">';
echo '<tr><th> Category </th><th> color </th><th> Description </th><th> Edit </th><th> Delete </th></tr> ';
foreach ($losts as $l)
{
echo '<tr><td> '.$l->category .'</td><td> '.$l->colour .'</td><td> '.$l->description .'</td><td><a href="/lost/'.$l->id.'/edit">Edit</td><td><a href="/lost/'.$l->id.'/delete">Delete</td></tr>';
Here is routes.php file on lostandfound\app\Http
<?php
Route::get('/', function ()
{
return view('help');
});
Route::get('help', function ()
{
return view('help');
});
Route::get('about', function ()
{
return view('about');
});
Route::auth();
Route::get('/home', 'HomeController@index');
Route::get('found/{id}/delete','PageController@desroy');
Route::resource('found','PageController');
Route::get('lost/{id}/delete','lostPageController@desroy');
Route::resource('lost','lostPageController');
Route::get('artical','articalController@artical');
Route::get ('user/{id}','articalController@userpost');
Route::get('profile', 'UserController@profile');
Route::post('profile', 'UserController@update');
Route::post('lsupport','SupportController@loststore');
Route::post('fsupport','SupportController@foundstore');
Route::get('showuser','AdminController@showuser');
Route::get('userdelete/{id}','AdminController@desroy');
Route::auth();
Route::get('/home', 'HomeController@index');
Route::auth();
Route::get('/home', 'HomeController@index');
Here is app2.blade.php file on lostandfound\resources\views\layouts
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title>@yield('title')</title>
<!-- Bootstrap Core CSS -->
<link href="<?php echo asset('/'); ?>vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
{!!Html::style('vendor/bootstrap/css/bootstrap.min.css')!!}
<!-- Theme CSS -->
<link href="css/clean-blog.min.css" rel="stylesheet">
<!-- Custom Fonts -->
<link href="vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
<link href='https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' rel='stylesheet' type='text/css'>
</head>
<body id="app-layout">
<nav class="navbar navbar-default navbar-static-top">
<div class="container">
@if(Session::has('flash_message'))
<div class="alert alert-success"></div>
@endif
<div class="navbar-header">
<!-- Collapsed Hamburger -->
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#app-navbar-collapse">
<span class="sr-only">Toggle Navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- Branding Image
<a class="navbar-brand" href="">
Laravel
</a>
-->
</div>
<div class="collapse navbar-collapse" id="app-navbar-collapse">
<!-- Left Side Of Navbar -->
<ul class="nav navbar-nav">
<!-- > <li><a href="">Home</a></li> -->
</ul>
<ul class="nav navbar-nav">
<li><a href="">Lost</a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="">Found</a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="">About</a></li>
</ul>
<ul class="nav navbar-nav">
<li><a href="">Help</a></li>
</ul>
<!-- Right Side Of Navbar -->
<!-- Right Side Of Navbar -->
<ul class="nav navbar-nav navbar-right">
<!-- Authentication Links -->
@if (Auth::guest())
<li><a href="">Login</a></li>
<li><a href="">Register</a></li>
@else <li>
<ul class="nav navbar-nav">
@if(Auth::user()->Admin == '1') <li><a href="">Show Users</a></li>
@endif
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">
Add Post <span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href=""><i class="fa fa-btn fa-book"></i>Lost</a></li>
<li><a href=""><i class="fa fa-btn fa-book"></i>Found</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" style="position: relative; padding-right: 70px;">
<img src="../uploads/profile/" style="width: 30px; height: 30px; position: absolute; top: 10px;right: 10px; border-radius: 50%;margin-right: 25px;">
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu">
<li><a href= ""><i class="fa fa-btn fa-user"></i>profile</a>
</li>
<li><a href= "/notifacation"><i class="fa fa-btn fa-book"></i>Notifacation</a></li>
<li><a href=""><i class="fa fa-btn fa-sign-out"></i>Logout</a></li>
</ul>
</li>
<li>
</li>
@endif
</ul>
</div>
</div>
</nav>
@yield('content')
<footer>
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<ul class="list-inline text-center">
<li>
<a href="https://twitter.com/">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-twitter fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="https://www.facebook.com/">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-facebook fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
<li>
<a href="#">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-github fa-stack-1x fa-inverse"></i>
</span>
</a>
</li>
</ul>
<p class="copyright text-muted">Copyright © LostandFound 2016</p>
</div>
</div>
</div>
</footer>
<!-- JavaScripts -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.3/jquery.min.js" integrity="sha384-I6F5OKECLVtK/BL+8iSLDEHowSAfUo76ZL9+kGAgTRdiByINKJaqTPH/QVNS1VDb" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
"></script> --}}
</body>
</html>
Here is UserController on lostandfound\app\Http\Controllers
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Auth;
use Illuminate\Support\Facades\Input;
class UserController extends Controller
{
public function profile()
{
return view('profile',array('user'=>Auth::user()));
}
public function update(Request $request)
{
if($request->hasFile('avatar')){
/
$avatar = $request->file('avatar');
$filename = time() . '.' . $avatar->getClientOriginalExtension();
$avatar->move('uploads/profile', $filename);
$user = Auth::user();
$user->image = $filename;
$user->save();
}
// retur to profile.blade.php
return view('profile', array('user' => Auth::user()) );
}
}
[hovering] http://prntscr.com/eq628d
[the error] http://prntscr.com/eq61w7
via Nischal Prajapati