I have installed MongoDb and I can create tables using both migrations and seeder.
My problems are:
When I put the command php artisan migrate, the flow not registered the name of the table into migrations table, in this way the console show me this error:
[MongoDB\Driver\Exception\RuntimeException] a collection
'victest.users' already exists
Where can I fix it?
The command php artisan migrate to create all tables of passport or others tables in migrations is not functional. Can I change this in the entire project?
use Illuminate\Database\Eloquent\Model;
to
use Jenssegers\Mongodb\Eloquent\Model as Model;
Now I have those problems, if someone had problems con mongodb and laravel passport please share you knowledge.
Thanks!
I have installed again laravel 5.3 and my problems with migrate were solutioned
thanks
Related
I am trying to create an API using Strapi CMS. I have an existing PostgreSQL + postgis database and I would like to connect-use this database in a Strapi project.
Do you know if it is possible to do something like this?
I was looking for an answer for this also, but it seems the only answer is no, because Strapi is not schema-agnostic: you must adopt their database structure to use Strapi.
Now if I could only figure out a way to ask Stack Overflow for a schema-agnostic headless CMS ... without getting it flagged as an invalid/subjective question ...
You can do it while you create a strapi app just choose custom and setup the database there. and to import existing tables from that db just create a mock table using strapi admin panel and in /api folder in your project root folder and copy paste the table data you just created in api folder and chage the name of that folder to the table name and do same for the files in side that folder and,
in the api>(your table folder)>config>routes.json file change the name of table inside I will add a link to help you better understand.
for setup in strapi with existing database>
configure-strapi-postgresql
I couldn't find the tut for setting up exist but this is for mysql setps are smilers.
strapi with sql
The best way is to create a new database with the same structure but created with strapi and after migrate the data.
You are creating an API using Strapi CMS.
There is no reason why your database should be Strapi database.
Just build your API with Strapi.
Or you can use this tutorial to integrate Strapi into your existing database as #Augusto Rodriguez said.
I'm trying to use PHINX as database query builder for SQL database. Does Phinx help only database migrations?
The document also has only about configuration and steps for migration.
https://phinx.org/
http://docs.phinx.org/en/latest/
From the documentation you posted:
Phinx is just about migrations without all the bloat of a database
ORM system or application framework
PHP has many options for ORMs, such as Redbean, Doctrine and my favorite, Eloquent (comes with Laravel)
I am using the first-time laravel, and want to use the laravel Auth for login and registration, MongoDB as backend. Using this command enables the laravel Auth
php artisan make:auth
will it work ? can anyone help me, how to do it..
php artisan make:auth
will just generate views since Laravel already comes with an Authentication feature so you don't have to build on scratch.
Now it is possible to have MongoDB as backend but it requires you to install a wrapper in order for Laravel to connect to your database.
I recommend using this one.
It requires PHP MongoDB extension to be installed in order for the package to fully work.
I tried to install "jenssegers/laravel-mongodb" from git
https://github.com/jenssegers/laravel-mongodb
and all the configuration has been done. but how can I know that my Laravel project successfully connected to MongoDB database?
Have you installed mongo? if not, here's a guide:
https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/
if you want to try if it works, simply try to save something to the db using eloquent.
Just remember that in your model, extend "Jenssegers\Mongodb\Eloquent\Model" instead of "Illuminate\Database\Eloquent\Model"
I am trying to build a basic web app, and I want to connect it to a database. I have a heroku account so I started trying to get it hooked up to a Postgres DB and ran into issues around SSL and external connections. I tried to update my code and realized that I was missing the references to SQL so tried adding Entity Framework through the package manager.
It goes through the checking compatibility and then tells me
Could not add Entity Framework
I am new to this so not sure what I can provide to help get the answer.
Am I just going about it wrong, is EF not what I need to make a simple DB connection?