in Education by
I want to submit some form information into my table, but this error is showing, if i do Route::resource('userinfo','infoController@index'); the error gone, but i can't insert data, what will be the solution. My controller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\infomodel; class infoController extends Controller { public function index() { $alldata = infomodel::all(); return $alldata; } public function create() { return view('userinfo.create'); } public function store(Request $request) { $input = $request->all(); infomodel:: create($input); return redirect('infomodel'); } } My model <?php namespace App; use Illuminate\Database\Eloquent\Model; class infomodel extends Model { Protected $table = "info"; protected $fillable = ['name', 'email', 'age', 'hometown']; } My route web.php <?php Route::resource('userinfo','infoController'); Route::get('/solid', function () { return view('solid.index'); }); This is view create.blade.php <!DOCTYPE html> Userinfo
{!! Form::open(['route' => 'userinfo.store']) !!}
{!! Form::close() !!} JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The problem is in your store method public function store(Request $request) { $input = $request->all(); infomodel:: create($input); return redirect('infomodel'); } You redirect user to non-existing route infomodel. Try this public function store(Request $request) { $input = $request->all(); infomodel:: create($input); // You can try 'return back()' as well return redirect()->route('userinfo.index'); }

Related questions

0 votes
    I want to submit some form information into my table, but this error is showing, if i do Route::resource('userinfo', ... can't insert data, what will be the solution. My controller...
asked Jul 14, 2022 in Education by JackTerrance
0 votes
    I am currently developing a recipe website with Laravel and I have run into an issue on my recipe show ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    I am currently developing a recipe website with Laravel and I have run into an issue on my recipe show ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 9, 2022 in Education by JackTerrance
0 votes
    This question already has answers here: How can I convert ereg expressions to preg in PHP? (4 answers) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 7, 2022 in Education by JackTerrance
0 votes
    I'm new to Laravel. I am trying to download this project and build from git(https://github.com/ ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    Can you arrange 9 numerals - 1, 2, 3, 4, 5, 6, 7, 8 and 9 [using each numeral just once] above and below a division line, to create a fraction equaling to 1/3 [one third]?...
asked Feb 13, 2021 in Education by JackTerrance
0 votes
    I have 2 buckets prod and dev. Inside .env I have S3_PROD and S3_DEV. I want my system to point ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 3, 2022 in Education by JackTerrance
0 votes
    I have 2 buckets prod and dev. Inside .env I have S3_PROD and S3_DEV. I want my system to point ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
    When I have started with the project using Laravel 5.7 and PHP 7.3, $info->id returned correctly the last insert id. Now, I did ... :1 [ 0 => "*" ] } This is my GfTableModel.php:...
asked Apr 29, 2022 in Education by JackTerrance
0 votes
    When I have started with the project using Laravel 5.7 and PHP 7.3, $info->id returned correctly the last insert id. Now, I did ... :1 [ 0 => "*" ] } This is my GfTableModel.php:...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    I use Laravel HTML to create form but I have problem, so in creating form I have: {!! Form:: ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 17, 2022 in Education by JackTerrance
0 votes
    What are default packages of Laravel 5.6?...
asked Sep 28, 2021 in Technology by JackTerrance
0 votes
    I'm trying to run PHP from the command line under Windows XP. That works, except for the fact ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    I'm trying to run PHP from the command line under Windows XP. That works, except for the fact ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 25, 2022 in Education by JackTerrance
0 votes
    I'm trying to run PHP from the command line under Windows XP. That works, except for the fact ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Mar 24, 2022 in Education by JackTerrance
...