Giter VIP home page Giter VIP logo

ethereal's People

Contributors

kevupton avatar

Stargazers

 avatar  avatar  avatar

Forkers

kikoseijo

ethereal's Issues

MorphModel seeder help.

Hello Sr,

Playing with this Wonderfull library but I bump in to an issue trying to make seeders-

got this:

$factory->define(App\Models\Post::class, function ($faker) {
    $taggable = [
        App\Models\PostVideo::class,
        App\Models\PostAudio::class,
    ];
    return [
        'title' => $faker->catchPhrase,
        'post_id'   => 1,
        'post_type' => $faker->randomElement($taggable),
    ];
});

$factory->defineAs(App\Models\Post::class, 'audio', function (Faker\Generator $faker) use ($factory) {
    $follow = $factory->raw(App\Models\Post::class);
    $extras = [
        'post_id'   => $faker->randomElement(App\Models\PostAudio::pluck('id')->toArray()),
        'post_type' => App\Models\PostAudio::class,
    ];
    return array_merge($follow, $extras);
});

I run the seeds doing this:

factory(App\Models\Post::class, 'soundcloud', rand(1,8))->create([
              'hub_id' => $hub->id
            ]);
            factory(App\Models\Post::class, 'youtube', rand(1,8))->create([
              'hub_id' => $hub->id
            ]);

main class

    // relationships
    public static $relationsData = [
        'post' => [self::MORPH_TO],
    ];

Subclass

    protected $morphBy = 'post';
    protected $morphTable = 'posts'; //the name of the parent table
    protected $morphModel = Post::class; //the class of the parent table

Its complaining about declaring the $relationsData in the subclass.

Symfony\Component\Debug\Exception\FatalThrowableError: Access to undeclared static property: App\Models\PostVideo::$relationsData in /Kevupton/Ethereal/Models/MorphModel.php:23

Any idea why? Need more info?
Thank you, excellent job btw.

Laravel-json-response

There is conflict here

   - kevupton/ethereal v2.4 requires kevupton/laravel-json-response dev-master -> satisfiable by kevupton/laravel-json-response[dev-master]but these conflict with your requirements or minimum-stability.

Will avoid updating.

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.