Hello Sir @marianomoreyra
Thank ya so much your answer worked :) !!! Now Im getting 404 not found error..I have a regular profile and Edit profile views..dont know where the error is showing from:
Profile view;
@extends('layouts/layout')
@section('content')
@if ($user->profile)
<h1>{{ $user->username }} <small>{{ $user->profile->location }}</small></h1>
<div class="bio">
<p>
{{ $user->profile->bio }}
</p>
</div>
<ul class="links">
<li>{{ link_to('http://twitter.com/' . $user->profile->twitter_username, 'Find Me On Twitter') }}</li>
<li>{{ link_to('http://facebook.com/' . $user->profile->facebook_username, 'Find Me On Facebook') }}</li>
<li>{{ link_to('http://instagram.com/' . $user->profile->instagram_username, 'Find Me On Instagram') }}</li>
</ul>
@if ($user->isCurrent())
{{ link_to_route('profile.edit', 'Edit Your Profile', $user->username) }}
@endif
@else
<p>No profile yet.</p>
@endif
@stop
Edit profile view:
@extends('layouts/layout')
@section('content')
<h1>Edit Profile</h1>
{{ Form::model($user->profile, ['method' => 'PATCH', 'route' => ['profile.update', $user->username]]) }}
<!-- Location Field -->
<div class="form-group">
{{ Form::label('location', 'Location:') }}
{{ Form::text('location', null, ['class' => 'form-control']) }}
{{ errors_for('location', $errors) }}
</div>
<!-- Bio Field -->
<div class="form-group">
{{ Form::label('bio', 'Bio:') }}
{{ Form::textarea('bio', null, ['class' => 'form-control']) }}
{{ errors_for('bio', $errors) }}
</div>
<!-- Twitter_username Field -->
<div class="form-group">
{{ Form::label('twitter_username', 'Twitter_username:') }}
{{ Form::text('twitter_username', null, ['class' => 'form-control']) }}
{{ errors_for('twitter_username', $errors) }}
</div>
<!-- Github_username Field -->
<div class="form-group">
{{ Form::label('github_username', 'Github_username:') }}
{{ Form::text('github_username', null, ['class' => 'form-control']) }}
{{ errors_for('github_username', $errors) }}
</div>
<!-- Update Profile Field -->
<div class="form-group">
{{ Form::submit('Update Profile', ['class' => 'btn btn-primary']) }}
</div>
{{ Form::close() }}
@stop