Hariom Vishwakarma
Hariom Vishwakarma

Reputation: 17

Laravel 6.0 input::value"old(' ')"

i am using this code but i am not working old function i have used both using this <?php echo old('title'); ?> AND {{ old('title') }} Both are not working

 <form action="<?php echo route('post.create') ?>" method="GET">
 @csrf
        <input type="text" name="title" value="<?php echo old('title');  ?>"></br>
        <textarea name="contant" id="" cols="30" rows="10"><?php echo old('contant'); ?></textarea>

Upvotes: 0

Views: 174

Answers (2)

Shahadat Hossain
Shahadat Hossain

Reputation: 155

If you want to use GET method use request helper function instead of old.

If you use POST method and stil not working. There are few solutions.

Use withInput() to go back with data

return back()->withInput()->withErrors('Add atleast one image in the post.');

Stack Overflow Ref

Not sure if you remember but i raised a thread the other day where i was having cache problems with Chrome. That might make sense. I tried Canary and same issue so perhaps it's chrome (if that's what OP is using) Please see this posts. Laracasts Ref

Upvotes: 0

Andy Song
Andy Song

Reputation: 4684

Change to post

method="POST"

Upvotes: 1

Related Questions