Questions tagged [ardent]

Ardent is a package that provides self-validating smart models for the Laravel framework's Eloquent O/RM.

Ardent provides self-validating smart models for Laravel Framework 4's Eloquent O/RM, based on the Aware bundle for Laravel 3. With it, Laravel validation rules can be inserted into the model's class as a tag variable. At save, the model will validate itself and modify the database or in faliure it gives error messages.

Installation

Add laravelbook/ardent as a requirement to composer.json:

{
    "require": {
        "laravelbook/ardent": "dev-master"
    }
}

Update the packages with composer update or install with composer install.

Useful links

57 questions
1
vote
0 answers

Laravel 5.2 (using Ardent) DB query causing bad gateway error

I'm in the process of upgrading a Laravel 4.1 app to 5.2 and am running into a problem with either Eloquent or Ardent in trying to do DB queries. Our app uses the Repository model, so the problem ends up structured like this: Controller block…
sitrick2
  • 170
  • 2
  • 10
1
vote
1 answer

Laravel Ardent many-to-many relationship is throwing error

I have an Ardent v3.3.0 model like this: class Company extends Ardent { protected $fillable = [ 'name', 'address' ]; public static $rules = [ 'name' => 'required', 'address' => 'string' ]; …
Zaki Aziz
  • 3,592
  • 11
  • 43
  • 61
1
vote
2 answers

Form validation of many-to-many relationship input field with Laravel

I have a many-to-many relationship between my articles and tags table, and want to require the user to input tags in the create/edit article form. I am using Ardent for my validation and have the following in my article model: class Article extends…
Thomas Jensen
  • 2,138
  • 2
  • 25
  • 48
1
vote
1 answer

How to set $fillable attributes for another table with hasOne relationship in a Laravel/Ardent model?

Suppose, I have these ardent models class User extends \LaravelBook\Ardent\Ardent { public $autoHydrateEntityFromInput = true; protected $fillable = array('username', 'password', 'address'); protected $table = 'Users'; public…
Vishwajeet Vatharkar
  • 1,146
  • 4
  • 18
  • 42
1
vote
0 answers

Why Laravel/Ardent is not saving data into database after save()?

Here's my Laravel/Ardent Model. I'm using auto-hydration. class Party extends \LaravelBook\Ardent\Ardent { public $autoHydrateEntityFromInput = true; public $forceEntityHydrationFromInput = true; protected $guarded = array(); protected $table =…
Vishwajeet Vatharkar
  • 1,146
  • 4
  • 18
  • 42
1
vote
1 answer

Having trouble getting fields to validate with Laravel / Ardent

I'm new to Laravel and am trying to figure out how to validate user input. I have a form with several text fields, a textarea and a checkbox: {{ Form::text('firstname', '', ['placeholder' => 'First Name', 'class' => 'form-control']) }} …
Jeremy Plack
  • 487
  • 1
  • 6
  • 16
1
vote
0 answers

Laravel Packages: Sentry and Ardent

Is it possible to combine the Sentry package and the Ardent package for Laravel? I want to use Ardent for validations while registering users, while Sentry is for authentication.
1
vote
1 answer

Ardent + Laravel, auto hydrate relation

I use lavarel with ardent package. I have some problem when i want to update a row. I have 2 model Client and Address related by morphone relation. This relation work well, when i want to get a client this line return expected result…
Felix_Billon
  • 690
  • 2
  • 10
  • 21
1
vote
1 answer

Laravel 'Form::model' does not populate my edit form

I am in the progress of making a form to edit an existing entry in the database. I am using the Form::model approach to do this, however it doesn't seem to work. The fields just stay empty. ServerController.php /** * Editing servers */ public…
Moeflon
  • 23
  • 5
1
vote
0 answers

Ardent password_confirmation error

I'm using ardent to validate my User model but for some reason it's always returning the two following errors: The password confirmation does not match. The password confirmation field is required. I've been stumped on the one for a while so any…
Shane Da Silva
  • 469
  • 1
  • 6
  • 15
1
vote
1 answer

Laravel/Ardent: SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters

I'm trying to validate a User using Ardent's validate() method, but I always receive the HY093 error with the following extra information (SQL: select count(*) as aggregate from:userswhereemail= my.email@gmail.com) I used Sentry2 for my 'users'…
jerney
  • 2,187
  • 1
  • 19
  • 31
1
vote
3 answers

Make Ardent in Laravel not requiring new password on save

I'm doing user editing facility for my admin panel. I want to ignore empty password on update, but not on create. I have following validation rules for User model: public static $rules = array( 'login' =>…
Cysioland
  • 1,126
  • 1
  • 9
  • 21
1
vote
1 answer

Laravel/Ardent: Is there a simpler way to do custom error messages?

Is there a simpler way to use custom validation error messages in Laravel rather than listing each field and attribute in an array? I don't mind the typing, I just feel it looks rather dirty. Here is my two blocks of code now... public static $rules…
user1316498
1
vote
6 answers

Fillable list ignored while inserting related model

I am using Ardent and I faced strange behaviour of ignoring $fillable list while inserting/updating related models. I have the following models defined: class User extends LaravelBook\Ardent\Ardent { protected $table = 'users'; public…
user2920996
1
vote
1 answer

Getting a throwOnFind: false response from Ardent in Laravel

I'm trying to perform an .ajax get to populate a table using Knockout/Jquery in Laravel 4. I use Ardent and it keeps responding with the following json response. {"throwOnFind":false} Controller: public function getData() { $roles =…
Chris
  • 644
  • 1
  • 12
  • 28