Coder Social home page Coder Social logo

imanghafoori1 / eloquent-relativity Goto Github PK

View Code? Open in Web Editor NEW
151.0 4.0 14.0 84 KB

Allows you to decouple your eloquent models from one another.

License: MIT License

PHP 99.58% Batchfile 0.42%
eloquent eloquent-models modularity laravel-package

eloquent-relativity's Issues

Trait free

Hi, great package!

Is there any chance to make this package trait free?

This package does not work when i use l5-repository

hi Mr. Ghafouri

i install this package in my project , but does not work Because i use l5-repository package

when

php artisan serve

get error when i use DynamicRelations in PostRepository :

Call to undefined method Prettus\Repository\Eloquent\BaseRepository::__call()

get error when i use DynamicRelations in BaseRepository:

Cannot access parent:: when current class scope has no parent

Is it possible to guide me about this? (tnx)

Suggestion: camelCase methods

Hi, this is a simple suggestion, but why the methods are not following the standard PSR-1?
Method names MUST be declared in camelCase.

I understand that there are already methods called like morphMany, so this is, i guess, the reason why you choose to use morph_many, but wouldn't fell more natural and readable to use methods like
attachMorphMany or addMorphMany or dynamicMorphMany?

Relationships mapper

Hi, currently to map all relationships added i'm using this:

use Illuminate\Support\Collection;
use ReflectionClass;
use App\Models\Foo;

$model = Foo::class;
$class = new ReflectionClass($model);
$property = $class->getProperty('dynamicRelations');
$property->setAccessible(true);
$methods = array_keys($property->getValue('dynamicRelations'));

Is there a way to do this without reflection?
Maybe adding an interface and a public method getDynamicRelations()

Thanks

L8?

Thank you for this, and your other packages. They are quite helpful for decoupling. Will this be updated to L8? It's basic dependency updates, really I'm curious if this package is maintained anymore.

Thanks for the great work. Much appreciated.

Conditional relationships

What should be the best approach to attach relationships based on a condition of the given entity if the class is the same?

For example:

  • attach relationship detail to all entities Book that have an attribute type=foo
  • attach relationship friends to entity BasicEntity that have table value cats

I'm asking this because i have one single Model that in each instance may have different table values because these models are defined in the database and there is only one class.

Can i make a PR about this or should i simple create an addon/extension?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.