You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
@@ -138,7 +138,7 @@ For example, user registration or blog post submission is a common coding requir
138
138
To create a new Ardent model, simply make your model class derive from the `Ardent` base class. In the next examples we will use the complete namespaced class to make examples cleaner, but you're encouraged to make use of `use` in all your classes:
139
139
140
140
```php
141
-
use LaravelBook\Ardent\Ardent;
141
+
use LaravelArdent\Ardent\Ardent;
142
142
143
143
class User extends Ardent {}
144
144
```
@@ -151,7 +151,7 @@ class User extends Ardent {}
151
151
Ardent models use Laravel's built-in [Validator class](http://laravel.com/docs/validation). Defining validation rules for a model is simple and is typically done in your model class as a static variable:
@@ -211,7 +211,7 @@ An array that is **not empty** will override the rules or custom error messages
211
211
Just like the Laravel Validator, Ardent lets you set custom error messages using the [same syntax](http://laravel.com/docs/validation#custom-error-messages).
212
212
213
213
```php
214
-
class User extends \LaravelBook\Ardent\Ardent {
214
+
class User extends \LaravelArdent\Ardent\Ardent {
215
215
public static $customMessages = array(
216
216
'required' => 'The :attribute field is required.',
217
217
...
@@ -242,7 +242,7 @@ Here's the complete list of available hooks:
242
242
For example, you may use `beforeSave` to hash a users password:
243
243
244
244
```php
245
-
class User extends \LaravelBook\Ardent\Ardent {
245
+
class User extends \LaravelArdent\Ardent\Ardent {
246
246
public function beforeSave() {
247
247
// if there's a new password, hash it
248
248
if($this->isDirty('password')) {
@@ -281,7 +281,7 @@ Have you ever written an Eloquent model with a bunch of relations, just to notic
281
281
In Ardent you can cleanly define your relationships in an array with their information, and they will work just like if you had defined them in methods. Here's an example:
282
282
283
283
```php
284
-
class User extends \LaravelBook\Ardent\Ardent {
284
+
class User extends \LaravelArdent\Ardent\Ardent {
285
285
public static $relationsData = array(
286
286
'address' => array(self::HAS_ONE, 'Address'),
287
287
'orders' => array(self::HAS_MANY, 'Order'),
@@ -342,7 +342,7 @@ It follows the same [mass assignment rules](http://laravel.com/docs/eloquent#mas
342
342
To enable the auto-hydration feature, simply set the `$autoHydrateEntityFromInput` instance variable to `true` in your model class. However, to prevent filling pre-existent properties, if you want auto-hydration also for update scenarios, you should use instead `$forceEntityHydrationFromInput`:
343
343
344
344
```php
345
-
class User extends \LaravelBook\Ardent\Ardent {
345
+
class User extends \LaravelArdent\Ardent\Ardent {
346
346
public $autoHydrateEntityFromInput = true; // hydrates on new entries' validation
347
347
public $forceEntityHydrationFromInput = true; // hydrates whenever validation is called
348
348
}
@@ -356,7 +356,7 @@ Ardent models can *auto-magically* purge redundant input data (such as *password
356
356
To enable this feature, simply set the `$autoPurgeRedundantAttributes` instance variable to `true` in your model class:
357
357
358
358
```php
359
-
class User extends \LaravelBook\Ardent\Ardent {
359
+
class User extends \LaravelArdent\Ardent\Ardent {
360
360
public $autoPurgeRedundantAttributes = true;
361
361
}
362
362
```
@@ -382,7 +382,7 @@ Suppose you have an attribute named `password` in your model class, but don't wa
382
382
To do that, add the attribute name to the `Ardent::$passwordAttributes` static array variable in your model class, and set the `$autoHashPasswordAttributes` instance variable to `true`:
383
383
384
384
```php
385
-
class User extends \LaravelBook\Ardent\Ardent {
385
+
class User extends \LaravelArdent\Ardent\Ardent {
386
386
public static $passwordAttributes = array('password');
0 commit comments