Comments (9)
@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.
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:
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.
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.
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.
@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.
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.
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.
@marktopper, was this ever resolved? Can it be closed? I see a Closed PR, but it was never merged.
from voyager.
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)
- Voyager doesn't load admin panel
- HasMany relation doesn't work
- Multiple BREAD for single table/model HOT 1
- Update docs for voyager 1.7
- Is it possible to translate BREAD BROWSE columns? HOT 5
- Whoopsie! The "" file does not exist or is not readable. HOT 3
- Unsupported image type image/heic. GD driver is only able to decode JPG, PNG, GIF, BMP or WebP files HOT 3
- media library's one of the folders is not loading HOT 3
- custom action not found on cpanel HOT 1
- How Authorize Works in Voyager and add Custom Roles? HOT 1
- Is there any way to upload the images to cloudinary or any cloud service HOT 6
- Migrate from Google Sign-In, for conection in Analytcs
- Unable to add BREAD to table HOT 5
- email_verified_at column reset to NULL HOT 1
- Laravel 11 Support HOT 12
- @can feature on menu items based on permissions
- Passing variable to view
- My Laravel Voyager admin redirect back to login page after successful login, but this issue occurs on initial login. After that it works fine.
- google analytics deprecated HOT 1
- Select Dropdown using enum->value instead of enum?
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 voyager.