Here's a newbie question for strapi but I haven't found it covered anywhere.
I have a ecommerce database and I would like to migrate my data to strapi. I managed to http post new items into the database but I dont know how to post the relationships. For example I managed to create a product via POST but I have no idea how to post its relationship with the manufacturer model.
Thanks.
I figured it out:
I just had to set a field with the name of the relation and the value of the related model's id. For some reason it haven't worked when I first tried this.
Related
I'm new to laravel backpack so what did is created a CRUD of title and description. And everything in admin panel works fine, but now I need to get that data to another blade view file through a controller like in a vanilla laravel but I cant seem to find how to do it.
If I understand your question correctly, there's absolutely NOTHING special you need to do - just do it "the normal Laravel way", by using your Model to query the database. It's usually something like Career::all() or Career::find($id) or Career::where('something', $value)->get(), depending on what you need to fetch from the database.
That's because Backpack uses your existing Eloquent Models, or creates the models if you don't have them already (usually in app\Models). So whenever you create/edit/delete an entry using the Backpack interface (aka CRUD), what Backpack does is use that Model to interact with the database. If you want to interact with the database, you should do the same thing - use the Model. That's the expected and recommended way of doing things in Laravel. To have Models for all your major database tables and do most (or all) of your interactions with the database using the Eloquent Models.
You can use view like this:
view('crud::show');
list, create etc.
all available files, you can find here: vendor/backpack/crud/src/resources/views/crud
If you want to override the template, please copy vendor template to your project
vendor/backpack/crud/src/resources/views/crud/show.blade.php > resources/views/vendor/backpack/crud/show.blade.php
I'ts just for practice and I need how to set up an Auth in Laravel but in the same table User. I know I have to use the default model User.php. I added my new column "type" where here I'm going to manage common users and admins. I edited and migrated that, also according to docs I created my guards and register providers but I don't know whats next. I know how to do it with another table but in the same table I have no idea how. I don't know how this Laravel's files works.
I have a Magento website with 3 languages on 3 different store view. I need to retrieve product information through the rest API, accessing to this address:
http://-mysite-/api/rest/products
It works really fine, but I receive data only from the default store view. In my webapp I need to switch languages, and I need to access to the others store view. I read the documentation (http://www.magentocommerce.com/api/rest/introduction.html), but I cannot find anything about store view and multilingual sites... I tried passing language in the header or passing the store_id as "get variable"... nothing, it works only with the default store view. Any idea?
You can try this. magentomysite/api/rest/products/store/storeid . For example you can use as magentomysite/api/rest/products/store/1 for english store products.
Remember one thing. In the admin panel you have to give permissions to guest user also. Then only you can get the data through this url.
I hope this helps u.
To elaborate on Pavan's answer the following URL worked for me:
magentodomain.com/api/rest/products/:product_id/store/:store_id
You can find your store id with the following method explained in this answer:
How to find out what my store ID is?
I created a new module following with this url:
In my module i created a registration form.
So now i want to insert the data entered into my registration form.
How is it possible?
Take a look at these instructions about models and database access:
http://www.magentocommerce.com/knowledge-base/entry/magento-for-dev-part-5-magento-models-and-orm-basics
This should get you up and running.
You need a custom db table with a custom model and collection of this table. There are lots of way but this is the magento way.
This link will help you http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/custom_module_with_custom_database_table
i need found in magento database information about users: description , status (login or not).
Where i can find this information in data base?
Thanks
Magento uses an EAV structure so finding information can be tricky.
There is a slightly out-of-date but useful overview diagram here:
http://inchoo.net/wp-content/uploads/2008/10/magento_v116-database_diagram.pdf
To answer part of your question, I don't think Magento stores the login status in the database, that would be stored in the session. Other details like description/username will be in one of the entity value tables.
Here's a good tutorial I found about EAV in Magento:
http://fishpig.co.uk/2010/06/07/magento-database-structure-eav/
You can also see a diagram of the Magento database by Googling Magento Database.