Support the ongoing development of Laravel.io →
posted 10 years ago
Requests

i am trying to do something very simple. Just create a user via an ajax post request

UserController.php

<?php namespace App\Http\Controllers;

use App\User;

class UserController  extends Controller  {

	public function store(   )
	{
		$user = new User;
		$user->first_name= Input::get('first_name');
		$user->last_name= Input::get('last_name');
		$user->save();
	}

	public function edit()
	{
		return view('users.form');
	}

}

but i get an error message

Class 'App\Http\Controllers\App\Input' not found

anyone?

Last updated 2 years ago.
0

I'm guessing you have to add use App\Input

Last updated 2 years ago.
0

\Input::get('first_name');

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

extjac extjac Joined 14 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.