Support the ongoing development of →
Input Eloquent Validation
Last updated 2 years ago.

If you have rules setup on each models it should work ok.

Alternatively, you could ditch ardent and use a Validation Service Class instead, to validate your input in one place.

Last updated 2 years ago.

I have rules set up for each model but it is not saving the form data. How should my form be set up for the additional models to pass through correctly?

For example, here is my admin notes form field:

{{ Form::textarea('adminNotes[notes]', $user->adminNotes->notes, array('class' => 'form-control', 'id' => 'notes', 'rows' => 3)) }}

My user model:

public function adminNotes()
    return $this->hasOne('AdminNote');

My admin notes model:

use LaravelBook\Ardent\Ardent;

class AdminNote extends Ardent {

	protected $fillable = array('user_id', 'notes');

	public static $rules = array(
		'notes' => 'required'

    public function user()
        return $this->belongsTo('User', 'user_id', 'id');
Last updated 2 years ago.

Sign in to participate in this thread!


Your banner here too?

robdiablo robdiablo Joined 4 Jun 2014


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

Your logo here?

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

© 2024 - All rights reserved.