Giter Club home page Giter Club logo

Comments (9)

brandonferens avatar brandonferens commented on May 13, 2024 2

@marktopper I'm assuming what you are wanting to do is extend the voyager models? If so, I would just create a model in my app and instead of extending Eloquent like normal, extend the Voyager class, which ultimately extends Eloquent.

from voyager.

tnylea avatar tnylea commented on May 13, 2024

Thanks! Yeah, you're right :)

There should have been a category_id in the posts migration. You can put in a PR for that and I can merge it in.

So, there isn't any $fillable or $guarded array. Each row will get added individually if the checkmark is checked for Edit and Add:

screen shot 2016-10-31 at 4 28 41 pm

You can copy and paste the posts folder to an admin folder inside of your resources and those files will be used instead. Since the posts already have a separate folder inside of the /vendor/tcg/voyager/src/views/posts those are used instead.

There are 2 files for each datatype which are: browse.blade.php and edit-add.blade.php. If you create a custom type for the 'slug', so products in this case it will be overridden.

I'll be adding more documentation for this soon.

Let me know if that makes sense. Have to bounce right now for some Halloween Festivities.

Talk to you soon.

from voyager.

brandonferens avatar brandonferens commented on May 13, 2024

I pushed up a pull request, but still curious your opinion on the relationships. Having to create the relationships inside of each model is the proper way to go, but having the backend system you've built makes that difficult. I've also noticed that in a couple places you have, for example, pulled all the categories in their own object and the pulled out the one needed for the given post or whatever. That is fine if the project remains small and there aren't many categories.

I'm not opposed to moving the models and whatnot outside of the package and adding those relationships, but then I would potentially miss out on package updates.

I'm wondering if there is a way to dynamically define the relationships... I want to play with some magic methods...

from voyager.

brandonferens avatar brandonferens commented on May 13, 2024

So the dynamic thing didn't workout too well. The last bit of the puzzle was determining the proper namespace. Brick wall.

So instead I decided the best approach would simply be, for the front end stuff at least, to create my own Post model that extends the Voyager Post model. This way, I am not overwriting the package model, nor am I missing out on potential package updates.

from voyager.

marktopper avatar marktopper commented on May 13, 2024

@brandonferens, I'm wondering what is the best approach to enable devs to overwrite the models.
Was thinking of using even Contracts or aliases? Any ideas?

from voyager.

ergxpr0xy avatar ergxpr0xy commented on May 13, 2024

i have the exact same problem, category_id didnt send to the DB. how can I fix this? i cant seems understand the discussion above.

from voyager.

marktopper avatar marktopper commented on May 13, 2024

I think I have finally figured out what's on here.

This is a case where the posts table and bread data is build from the seeder, and it's actually missing the category_id.

I will make sure to add this.

from voyager.

fletch3555 avatar fletch3555 commented on May 13, 2024

@marktopper, was this ever resolved? Can it be closed? I see a Closed PR, but it was never merged.

from voyager.

github-actions avatar github-actions commented on May 13, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.

from voyager.

Related Issues (20)

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.