It doesn't look like illuminate/html supports the number method in 5.0. You can use:
{!! Form::input('number', 'number', null) !!}
As for null values, the reason you're inserting an empty string rather than NULL into your database is that because null and '' are not equivalent. You'll need to explicitly insert null for any empty fields that you need - either via model attribute or checking in your controller method. The option you choose will depend on how many places you're actually setting the values. More than once and you'll want to do it in the model.
class MyModel extends Model {
protected $fillable = [ 'name', 'number', 'description', ];
public function setNameAttribute($name)
{
$this->attributes['name'] = trim($name) !== '' ? $name : null;
}
public function setNumberAttribute($number)
{
$this->attributes['number'] = trim($number) !== '' ? $number : null;
}
public function setDescriptionAttribute($description)
{
$this->attributes['description'] = trim($description) !== '' ? $description : null;
}
}
Now you can just drop your request parameters directly into your model:
class MyController extends Controller {
public function store(Request $request)
{
return MyModel::create($request->all());
}
}
As an aside, if you want Form::number, this is provided by the (maintained) laravelcollective/html package.