Comments (4)
What about the associate method ?
Example :
I update or create a random model. I want to associate a random relation to this model.
Because there is no before hook, I would do this :
// Update the model
$model = $modelRepository->update(
$attributes,
$modelId
);
// Associate a model
$model->relation()->associate($relation);
// And then again save
$model->save();
This will make two queries, when we can make one. (like for issue #75 )
EDIT : to be clear, we could associate the model in a beforeUpdate() method and avoid the second query.
from l5-repository.
+1
from l5-repository.
I've been very busy in recent months with my work projects, which eventually pulling away of my personal projects, so it could not provide the necessary support to you, I am more relaxed now and I'm checking all the issues in order to work on fixes and new implementations, apologize to everyone.
from l5-repository.
How about passing also the object in the state before the update to RepositoryEntityUpdated
event ?
Like on the delete event.
Would help a lot with testing since the native model events are not triggered when running tests.
from l5-repository.
Related Issues (20)
- RequestCriteria supports for Morph relationship
- Cache doesn't work
- Target class [] does not exist
- L9 Command "make:rest-controller" is not defined HOT 3
- depricated error on request citeria
- Do you have plans to update to support mongodb?
- time search on date not working HOT 2
- how to use it with yajra datatable
- Add Laravel 10 support HOT 4
- how to use exists() or doesntExist() method HOT 1
- Screenshot (Apr 25, 2023 11:23:51 PM)
- Invalid URL separator (semicolon) HOT 1
- how to search with the searchable fields with multiple values in one field ?
- Communication channel regarding security issue @andersao HOT 1
- Query Expression with laravel 10 and whereRaw query
- Can not use function simplePaginate with Presenter
- Laravel 10 criteria no longer work? HOT 2
- Hi HOT 1
- searchJoin=and doesn,t work HOT 1
- Need Laravel 11 Support HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from l5-repository.