This repository has been archived by the owner on Jul 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 211
Fixed #144 #176
Closed
dalabarge
wants to merge
5
commits into
laravel-ardent:bexarcreativeinc-master
from
bexarcreativeinc:bexarcreativeinc-master
Closed
Fixed #144 #176
dalabarge
wants to merge
5
commits into
laravel-ardent:bexarcreativeinc-master
from
bexarcreativeinc:bexarcreativeinc-master
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The validating event works when bound in the boot() function with the following code. <?php class Record extends Ardent{ static public function boot(){ parent::boot(); self::validating(function($record){ // this always works }); } } The observable object binding of the validating event only works if the $observables property includes "validating" in its array and is subsequently returned in the array when calling getObservableEvents(). <?php class Record extends Ardent{ // only works if this is set public $observables = array('validating'); } class Observer { public function validating($model){ // works if $observables = array('validating'); } } Record::observe(new Observer); The getObservableEvents() needs to be extended in the Ardent class to work correctly.
Including observable events for 'validating' and 'validated'
…pivotKeys` and `timestamps` are optional named arguments.
@igorsantos07 I don't have unit tests on these. The Hopefully now it'll be ready for release. |
I could use this. :) |
@mAAdhaTTah feel free to use something like this in composer until it's merged: {
"repositories": [
{
"type": "package",
"package": {
"name": "laravelbook/ardent",
"version": "2.4.3",
"source": {
"type": "git",
"url": "https://github.com/bexarcreativeinc/ardent.git",
"reference": "bexarcreativeinc-master"
},
"require": {
"php": ">=5.3.0",
"illuminate/support": "4.x",
"illuminate/database": "4.x",
"illuminate/validation": "4.x"
},
"autoload": {
"psr-0": {
"LaravelBook\\Ardent": "src/"
}
}
}
}
]
} |
@mAAdhaTTah and anyone else interested, there is now https://github.com/esensi/model which although does not support relationship bindings with pivot keys and timestamps (yet, it's on the roadmap) does use traits for all this sort of stuff and includes unit tests and an MIT license. Check it out if you want. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.