Closed mohamedaitbella closed 5 years ago
1.) yes this is completely fine, the module was designed to be usable standalone. 2.) Migrations are in the src/resources/database/migrations folder.
They get automatically registered if you properly boot the module:
Install the order module with composer:
composer require vanilo/order
Add the module to config/concord.php
:
<?php
return [ 'modules' => [ Vanilo\Order\Providers\ModuleServiceProvider::class ] ];
To get you on the right path, please read these sections, it takes 10 minutes and they're crucial:
https://vanilo.io/docs/0.4/modules-vs-framework
https://vanilo.io/docs/0.4/concord
https://vanilo.io/docs/0.4/models
https://vanilo.io/docs/0.4/orders
let me please share what i did maybe maybe i forget something or something is missing at least for me . **- im working on larave 5.7 php 7.2 what i did / steps to reproduce error
composer require konekt/concord
composer require vanilo/order
enum type ['billing','business','contract','mailing','pickup','residential','shipping','']
php artisan vendor:publish --provider="Konekt\Concord\ConcordServiceProvider" --tag=config
return [ 'modules' => [ Vanilo\Order\Providers\ModuleServiceProvider::class ] ];
and lastly run order migration ' php artisan migrate '
now it give me this error
order is requiring this table befor order migrations so i did the migration country and addresses i escapte this error by doing it manialy
enum type ['billing','business','contract','mailing','pickup','residential','shipping','']
You must add konekt/address
module to fix that error, don't do it manually. konekt/address
is already a dependency for vanilo/order
so you don't need to add it with composer. But you must add the module to config/concord.php
like so:
<?php
return [
'modules' => [
Vanilo\Order\Providers\ModuleServiceProvider::class,
Konekt\Address\Providers\ModuleServiceProvider::class,
]
];
now it give me this error
FQN(Fully Qualified Name) for Order model is
Vanilo\Order\Models\Order
not
Vanilo\Order\Model\Order
s is missing.
You need to change bigIncrements
Schema::create('users', function (Blueprint $table) {
$table->bigIncrements('id');
...
to increments
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
...
in users migration.
Or if you want to keep it that way, you can change every $table->integer('user_id')->unsigned()
in module migrations to $table->bigInteger('user_id')->unsigned()
. This can be changed in the near future, you can follow this issue.
The bigInteger issue is gone now, you could either upgrade the Order module to 0.5.2
or to 1.0@dev
The safest way is to run:
composer update vanilo/order
im trying to use this module out of vanilophp but there is no migration 1- is it fine to use order as standalone model ? 2- where i can find migrations ? this model does not have it's own migration thanks you for the hard work .