Code Monkey home page Code Monkey logo

voyager-deployment-orchestrator's Issues

Installation question

Hi
To install this, do I need Voyager already in my project, or this creates the Voyager package?

Regards
Adrian

VoyagerDeploymentOrchestratorSeeder seederpath is wrong

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.

Target class [DrudgeRajen\VoyagerDeploymentOrchestrator\ContentManger\FileSystem] does not exist

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!

Stub Variable 'datatype_slug_statements' rendering in seed files

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.

Exception occur PDOException: SQLSTATE[22007]: Invalid datetime format: 1292 Incorrect datetime value: 'THE DATE' for column 'created_at'

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.

Order of Menu Item for a bread data type is not seeded correctly

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.

Support for Laravel 8

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.

Deprecation Notice

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.