drudgerajen / voyager-deployment-orchestrator Goto Github PK
View Code? Open in Web Editor NEWVoyager Deployment Orchestrator - Generate Seed Files for BREAD and table.
License: MIT License
Voyager Deployment Orchestrator - Generate Seed Files for BREAD and table.
License: MIT License
Hi
To install this, do I need Voyager already in my project, or this creates the Voyager package?
Regards
Adrian
When trying to run php artisan db:seed --class=VoyagerDeploymentOrchestratorSeeder I got an error that it couldn't find the seeder file in /database/breads/seeds. The seeder files are of course in /database/seeds/breads.
I fixed the seeder path in VoyagerDeploymentOrchestratorSeeder and it fixed it. It looks to be wrong in your repository. I am not 100% sure how this worked before, since this setting must have been wrong before.
Hi, i'm getting the following error [DrudgeRajen\VoyagerDeploymentOrchestrator\ContentManger\FileSystem] does not exist.
Using Laravel Framework 6.18.38
It happens every time i do a require composer require drudge-rajen/voyager-deployment-orchestrator, php artisan optimize, composer dump-autoload... and so.
Illuminate\Contracts\Container\BindingResolutionException : Target class [DrudgeRajen\VoyagerDeploymentOrchestrator\ContentManger\FileSystem] does not exist.
at /var/www/vhosts/example.com/example.example.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:805
801|
802| try {
803| $reflector = new ReflectionClass($concrete);
804| } catch (ReflectionException $e) {
> 805| throw new BindingResolutionException("Target class [$concrete] does not exist.", 0, $e);
806| }
807|
808| // If the type is not instantiable, the developer is attempting to resolve
809| // an abstract type such as an Interface or Abstract Class and there is
Exception trace:
1 ReflectionException::("Class DrudgeRajen\VoyagerDeploymentOrchestrator\ContentManger\FileSystem does not exist")
/var/www/vhosts/example.com/example.example.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:803
2 ReflectionClass::__construct("DrudgeRajen\VoyagerDeploymentOrchestrator\ContentManger\FileSystem")
/var/www/vhosts/example.com/example.example.com/vendor/laravel/framework/src/Illuminate/Container/Container.php:803
Please use the argument -v to see more details.
Please help,
Thanks!
Encountering an issue where the {{datatype_slug_statements}}
stub variable is being rendered in the seed files for sluggable models. Occurs with a clean install of voyager & default config.
Here's the full seeder being generated:
use Illuminate\Database\Seeder;
use TCG\Voyager\Models\DataType;
use TCG\Voyager\Models\Menu;
use TCG\Voyager\Facades\Voyager;
use TCG\Voyager\Models\MenuItem;
class PagesBreadTypeAdded extends Seeder
{
/**
* Auto generated seed file
*
* @return void
*
* @throws Exception
*/
public function run()
{
try {
\DB::beginTransaction();
$dataType = DataType::where('name' , 'pages')->first();
if (is_bread_translatable($dataType)) {
$dataType->deleteAttributeTranslations($dataType->getTranslatableAttributes());
}
if ($dataType) {
DataType::where('name', 'pages')->delete();
}
\DB::table('data_types')->insert([
'name' => 'pages',
'slug' => 'pages',
'display_name_singular' => 'Page',
'display_name_plural' => 'Pages',
'icon' => NULL,
'model_name' => 'App\\Page',
'policy_name' => NULL,
'controller' => NULL,
'description' => NULL,
'generate_permissions' => 1,
'server_side' => 0,
'details' => '{"order_column":null,"order_display_column":null,"order_direction":"asc","default_search_key":null}',
'created_at' => '2019-02-26 17:56:03',
'updated_at' => '2019-02-26 18:03:13',
]);
{{datatype_slug_statements}}
Voyager::model('Permission')->generateFor('pages');
$menu = Menu::where('name', config('voyager.bread.default_menu'))->firstOrFail();
$menuItem = MenuItem::firstOrNew([
'menu_id' => $menu->id,
'title' => 'Pages',
'url' => '',
'route' => 'voyager.pages.index',
]);
$order = Voyager::model('MenuItem')->highestOrderMenuItem();
if (!$menuItem->exists) {
$menuItem->fill([
'target' => '_self',
'icon_class' => '',
'color' => null,
'parent_id' => null,
'order' => $order,
])->save();
}
} catch(Exception $e) {
throw new Exception('Exception occur ' . $e);
\DB::rollBack();
}
\DB::commit();
}
}
And here is the VDO config:
return [
'tables' => [
'pages',
'posts',
'users',
'roles'
//tables names for generating bread seeders.
],
];
We're also getting a ModelNotFoundException
for the voyager vendor Menu model. But i'll post another issue for that.
Not sure what is wrong, but I had to change this line into database/seeds/breads/
. Is it bug or I did something wrong?
When I tried to run seed, it said path does not exists
PHP Warning: Use of undefined constant nationalities - assumed 'nationalities' (this will throw an Error in a future version of PHP) in /var/www/html/laravel/config/voyager-deployment-orchestrator.php on line 6
always showing this warning for any artisan commands.
Firstly - Great Tool! It helps a lot.
Secondly - There is some issues with the generated timestamps in the seeders. When
$ CompaniesBreadTypeAdded.php
\DB::table('data_types')->insert([
...
'created_at' => '2020-04-18T18:58:51.000000Z'
]);
is executed generates Exception occur PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: '2020-04-18T18:44:23.000000Z' for column 'created_at'
temp fix is to just set it to null
but be really happy if that gets fixed.
A small suggestion for a good improvement could be using the Voyager's build in DataRow
and DataType
models rather than the \DB
.
This awesome library need listen to "permission_role" table / bread
I move the menu_item to some order, then when re-migrate my tables and run this orchestrator package, the order set for the menu_item is always in the last.
I think we need to listen on the event when the menu_item is moved up or down and saved it in the seeder.
Link to upgrade guide: https://laravel.com/docs/8.x/upgrade#seeder-factory-namespaces
During the generation of the seeder files, we need to add the namespaces
Seeders and factories now use namespaced classes. To accommodate for these changes, add a namespace Database/Factories to your factory classes and Database/Seeders to your seeder classes:
Also, the path to store the seeder files should be changed from database/seeds/breads
to database/seeders/breads
.
The previous database/seeds directory should be renamed to database/seeders.
Laravel: ^7.0
Composer: 1.10.5
composer dump-autoload
displays deprecation warning.
Message:
Deprecation Notice: Class DrudgeRajen\VoyagerDeploymentOrchestrator\ContentManger\FileSystem located in ./vendor/drudge-rajen/voyager-deployment-orchestrator/src/ContentManager/FileSystem.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/Cellar/composer/1.10.5/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.