Giter Club home page Giter Club logo

laravel-ide-helper-hook-eloquent-has-many-deep's Introduction

DEPRECATED:

The Laravel IDE-helper hook has been added to the main repo, see:

Laravel IDE Helper Hook EloquentHasManyDeep

Software License GitHub Tests Action Status Coverage Status Latest Version on Packagist Total Downloads

A Laravel Package for adding EloquentHasManyDeep support to Laravel IDE Helper Laravel IDE Helper.

Installation

You can install the package via composer:

composer require --dev daniel-de-wit/laravel-ide-helper-hook-eloquent-has-many-deep

The EloquentHasManyDeep Hook is loaded using Package Discovery, when disabled read Manual Installation.

Usage

Run standard model generation commands as normal:

php artisan ide-helper:models "App\Models\Post"

Docblocks will be added to the model

Manual Installation

When disabled, register the LaravelIdeHelperHookEloquentHasManyDeepServiceProvider manually by adding it to your config/app.php

/*
 * Package Service Providers...
 */
 DanielDeWit\LaravelIdeHelperHookEloquentHasManyDeep\Providers\LaravelIdeHelperHookEloquentHasManyDeepServiceProvider::class,

Testing

composer test

Credits

License

The MIT License (MIT). Please see License File for more information.

laravel-ide-helper-hook-eloquent-has-many-deep's People

Contributors

daniel-de-wit avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

hichxm

laravel-ide-helper-hook-eloquent-has-many-deep's Issues

Why using Safe/array_flip()

Hi, I use for first time your project. It was pretty cool, but you use the following function. Which not working.

use function Safe\array_flip; // src/Hooks/EloquentHasManyDeepHook.php:23

class EloquentHasManyDeepHook implements ModelHookInterface 
{
    protected function getUsedClassNames(ReflectionClass $reflection): array
    {
        $namespaceAliases = array_flip((new ContextFactory())->createFromReflector($reflection)->getNamespaceAliases()); // line 185
        $namespaceAliases[$reflection->getName()] = $reflection->getShortName();

        return $namespaceAliases;
    }
}

I got this error with command php artisan ide-helper:models -M:

Exception: Call to undefined function Safe\array_flip()

When I remove the 23 line of code. Now he is works very well.

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.