Releases: Vinelab/NeoEloquent
Releases · Vinelab/NeoEloquent
Migration & Schema
Thanks to the efforts put by @qejk this release introduces Migrations and Schema features to NeoEloquent.
Migrations
You may now use the neo4j
artisan command namespace to access migration commands:
neo4j:migrate Run the database migrations
neo4j:migrate:make Create a new migration file
neo4j:migrate:reset Rollback all database migrations
neo4j:migrate:refresh Reset and re-run all migrations
neo4j:migrate:rollback Rollback the last database migration
Schema
You may create and drop unique and index constraints using the Neo4jSchema
facade:
Neo4jSchema::label('User', function(Blueprint $label)
{
$label->unique('uuid');
$label->index('email');
});
In addition to some bug fixes and readme enhancements.
Quick Patch
Patched the has() method after a change in Illuminate.
Settled
New
- Connection authentication. Thanks to @thylo's PR
Fixes
- Fixed issue #9
- Fixed issue #11
- Fixed issue #12
- Fixed issue #13
- Fixed issue #14
- Fixed issue #16
- Fixed issue #17
- Fixed issue #18
- Fixed issue #19
- Fixed issue #28
- Fixed an issue where passing
null
on a value when updating a node doesn't set the field, it just ignores it - Fixed an issue where passing
false
on a value when updating saves it as 0 instead - Change the return value of
->update($attributes)
fromResultSet
to the count of records that were affected by the update - Fixed an issue where using boolean or null values in
createWith(...)
model attributes results in an error, especially withfalse
andnull
, alsotrue
was being converted by PHP to its equivalent int value
SensioLabs Insight Violations
- Replaced global function declaration with class function
- Avoided using logical operators
- Add required
use
statements - Type-hint object params
- Strict comparison for booleans
- Fixed unused variables, properties and parameters
- Removed unused
use
statements - Removed unused commented out code
Bringing Order
1.0.4
Aggregate
- Added support for aggregation methods like
max
min
avg
sum
and more. - Added
sync()
attach()
anddetach()
support for all relations inheriting fromHasOneOrMany
so they now apply toHasOne
HasMany
andbelongsToMany
relationships. - Fixed an issue with formatting the query when querying using
whereIn
whereBetween
andwhereNull
usingId
. - Fixed an issue where touching models always saves the model even when not needed when using
createWith
. - Enhanced the
QueryException
message.
Overnight Patch
- Add
whereHas()
support toBelongsTo
relationship by implementing the required methods and adding them to theRelationInterface
to be enforced - Fix an issue where querying multiple relations with multiple
whereHas
statements would consider the query the parent model instead of the related after the firstwhereHas
call
Perfect Cocktail
updating composer requirement to be able to download on stable
stability.
Nocturne in PHP Sharp Minor
New in RC 3
- Added
createWith()
: A method that allows creating or attaching multiple related models with one hit.
$tagsIds = [1, 2];
Post::createWith(['title' => 'the title', 'body' => 'the body'], [
'tags' => $tagsIds,
'photos' => [
[
'url' => 'http://url',
'caption' => '...',
'metadata' => '...'
],
[
'url' => 'http://other.url',
'caption' => 'the bay',
'metadata' => '...'
]
],
'videos' => [
'title' => 'Boats passing us by',
'description' => '...'
]
]);
- Added support for
insert
with multiple records.
Model::insert([
[
'key' => 'value',
'otherkey' => 'othervalue'
],
[
'key' => 'value',
'otherkey' => 'othervalue'
]
]);
Improvements & Bug Fixes
- Fixed SoftDeleting issue - requires
use
ingVinelab\NeoEloquent\Eloquent\SoftDeletingTrait
instead ofIlluminate\Database\Eloquent\SoftDeletingTrait
- Fixed the direction of
belongsToMany
relationships to beINCOMING
instead ofOUTGOING
- Fixed an issue where querying parent models after
whereHas
would query the related model instead of the parent - Improved Cypher queries with Ids where they used to be a static
_nodeId
, modified to be the concatenation of the node identifier andid
Perfect Cocktail
This is it! The first stable release is out! 😸
Improvements
createWith
to support passing in aCollection
like:
Post::createWith(..., ['tags'=>Tag::all()]);
- Saving related models with
createWith
to have timestamps hasMany
relationship generates the correct relationship label when not provided
Still Missing
- Firing model events when not working with
save()
in places likecreateWith
- Edges to fire events
- Support for
AND
,OR
,XOR
andNOT
operators - Support for
[x]
and[x..y]
operators - Functional tests for
Traversals
- a
cypher()
method that allows running a rawCypher
query