staudenmeir / eloquent-json-relations

Laravel Eloquent relationships with JSON keys
MIT License
1k stars 63 forks source link

Trait 'Staudenmeir\EloquentJsonRelations\HasJsonRelationships' not found #31

Closed kchecoMP closed 4 years ago

kchecoMP commented 4 years ago

Installed in my Laravel 5.8 project recently and was unable to get trait to load. I ran composer dump-autoload and php artisan cache:clear.

I was able to get it to work by adding "Staudenmeir\EloquentJsonRelations\": "vendor/staudenmeir/eloquent-json-relations/src/" to composer.json under autoload.ps4 and autoload-dev.ps4.

Is there another solution?

staudenmeir commented 4 years ago

What's the output of composer show?

Can you share your composer.json file?

kchecoMP commented 4 years ago

Currently, I work on my local machine which automatically syncs changes to my own test server where install needed packages on my test server. I was having issues installing this package on my test server so I installed it on my local machine and pushed out to test server. When I loaded was testing relationships using php artisan tinker I kept getting "Trait 'Staudenmeir\EloquentJsonRelations\HasJsonRelationships' not found". I resolved issue with composer by enabling swap and reinstalled package. May be a unique issue but you may close this ticket.

this is the output whe I run composer show:

aacotroneo/laravel-saml2              1.0.0              A Laravel package for Saml2 integration as a SP (service provider) based on OneLogin toolkit, which is much lightweight than simplesamlphp
aws/aws-sdk-php                       3.91.3             AWS SDK for PHP - Use Amazon Web Services in your PHP project
barryvdh/laravel-dompdf               v0.8.4             A DOMPDF Wrapper for Laravel
barryvdh/laravel-ide-helper           v2.6.2             Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.
barryvdh/reflection-docblock          v2.0.6            
beyondcode/laravel-dump-server        1.2.2              Symfony Var-Dump Server for Laravel
bogardo/mailgun                       v5.0.4             Laravel package for sending mail via the Mailgun API
clue/stream-filter                    v1.4.0             A simple and modern approach to stream filtering in PHP
composer/ca-bundle                    1.1.4              Lets you find a path to the system CA bundle, and includes a fallback to the Mozilla CA bundle.
composer/composer                     1.8.4              Composer helps you declare, manage and install dependencies of PHP projects, ensuring you have the right stack everywhere.
composer/semver                       1.5.0              Semver library that offers utilities, version constraint parsing and validation.
composer/spdx-licenses                1.5.1              SPDX licenses list and validation library.
composer/xdebug-handler               1.3.2              Restarts a process without xdebug.
dnoegel/php-xdg-base-dir              0.1                implementation of xdg base directory specification for php
doctrine/cache                        v1.8.0             Caching library offering an object-oriented API for many cache backends
doctrine/dbal                         v2.9.2             Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.
doctrine/event-manager                v1.0.0             Doctrine Event Manager component
doctrine/inflector                    v1.3.0             Common String Manipulations with regard to casing and singular/plural rules.
doctrine/instantiator                 1.2.0              A small, lightweight utility to instantiate objects in PHP without invoking their constructors
doctrine/lexer                        v1.0.1             Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
dompdf/dompdf                         v0.8.3             DOMPDF is a CSS 2.1 compliant HTML to PDF converter
dragonmantank/cron-expression         v2.3.0             CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
duosecurity/duo_php                   dev-master 55653f3 A PHP implementation of the Duo Web SDK.
egulias/email-validator               2.1.7              A library for validating emails against several RFCs
erusev/parsedown                      1.7.3              Parser for Markdown.
fideloper/proxy                       4.1.0              Set trusted proxies for Laravel
filp/whoops                           2.3.1              php error handling for cool kids
fzaninotto/faker                      v1.8.0             Faker is a PHP library that generates fake data for you.
guzzlehttp/guzzle                     6.3.3              Guzzle is a PHP HTTP client library
guzzlehttp/promises                   v1.3.1             Guzzle promises library
guzzlehttp/psr7                       1.5.2              PSR-7 message implementation that also provides common utility methods
hamcrest/hamcrest-php                 v2.0.0             This is the PHP port of Hamcrest Matchers
huddledigital/zendesk-laravel         v3.0               Laravel wrapper for zendesk/zendesk_api_client_php package
jakub-onderka/php-console-color       v0.2              
jakub-onderka/php-console-highlighter v0.4               Highlight PHP code in terminal
jenssegers/rollbar                    v1.5.1             Rollbar error monitoring integration for Laravel projects
justinrainbow/json-schema             5.2.8              A library to validate a json schema.
kylekatarnls/update-helper            1.2.0              Update helper
laravel/cashier                       v9.2.1             Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
laravel/dusk                          v5.11.0            Laravel Dusk provides simple end-to-end testing and browser automation.
laravel/framework                     v5.8.10            The Laravel Framework.
laravel/slack-notification-channel    v2.0.0             Slack Notification Channel for laravel.
laravel/tinker                        v1.0.8             Powerful REPL for the Laravel framework.
laravelcollective/html                v5.8.0             HTML and Form Builders for the Laravel Framework
league/flysystem                      1.0.51             Filesystem abstraction: Many filesystems, one API.
league/flysystem-aws-s3-v3            1.0.22             Flysystem adapter for the AWS S3 SDK v3.x
league/flysystem-sftp                 1.0.18             Flysystem adapter for SFTP
lob/lob-php                           v3.0.3             Lob.com API PHP wrapper.
maatwebsite/excel                     3.1.11             Supercharged Excel exports and imports in Laravel
mailgun/mailgun-php                   2.8.1              The Mailgun SDK provides methods for all API functions.
markbaker/complex                     1.4.7              PHP Class for working with complex numbers
markbaker/matrix                      1.2.0              PHP Class for working with matrices
mmucklo/inflect                       v0.3.0             inflect - a memoizing inflector for php
mockery/mockery                       1.2.2              Mockery is a simple yet flexible PHP mock object framework
monolog/monolog                       1.24.0             Sends your logs to files, sockets, inboxes, databases and various web services
mtdowling/jmespath.php                2.4.0              Declaratively specify how to extract elements from a JSON document
myclabs/deep-copy                     1.8.1              Create deep copies (clones) of your objects
nesbot/carbon                         1.39.0             A simple API extension for DateTime.
nikic/php-parser                      v4.2.1             A PHP parser written in PHP
nunomaduro/collision                  v2.1.1             Cli error handling for console/command-line PHP applications.
onelogin/php-saml                     3.1.1              OneLogin PHP SAML Toolkit
opis/closure                          3.1.6              A library that can be used to serialize closures (anonymous functions) and arbitrary objects.
paragonie/random_compat               v9.99.99           PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
phar-io/manifest                      1.0.3              Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                       2.0.1              Library for handling version information and constraints
phenx/php-font-lib                    0.5.1              A library to read, parse, export and make subsets of different types of font files.
phenx/php-svg-lib                     v0.3.2             A library to read, parse and export to PDF SVG files.
php-http/client-common                1.9.1              Common HTTP Client implementations and tools for HTTPlug
php-http/discovery                    1.6.1              Finds installed HTTPlug implementations and PSR-7 message factories
php-http/guzzle6-adapter              v1.1.1             Guzzle 6 HTTP Adapter
php-http/httplug                      v1.1.0             HTTPlug, the HTTP client abstraction for PHP
php-http/message                      1.7.2              HTTP Message related tools
php-http/message-factory              v1.0.2             Factory interfaces for PSR-7 HTTP Message
php-http/multipart-stream-builder     1.0.0              A builder class that help you create a multipart stream
php-http/promise                      v1.0.0             Promise used for asynchronous HTTP requests
php-webdriver/webdriver               1.8.2              A PHP client for Selenium WebDriver. Previously facebook/webdriver.
phpdocumentor/reflection-common       1.0.1              Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock     4.3.0              With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver           0.4.0             
phpoffice/phpspreadsheet              1.10.0             PHPSpreadsheet - Read, Create and Write Spreadsheet documents in PHP - Spreadsheet engine
phpoption/phpoption                   1.5.0              Option Type for PHP
phpseclib/phpseclib                   2.0.15             PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.
phpspec/prophecy                      1.8.0              Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage             6.1.4              Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator             2.0.2              FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-text-template             1.2.1              Simple template engine.
phpunit/php-timer                     2.1.1              Utility class for timing
phpunit/php-token-stream              3.0.1              Wrapper around PHP's tokenizer extension.
phpunit/phpunit                       7.5.8              The PHP Unit Testing framework.
psr/cache                             1.0.1              Common interface for caching libraries
psr/container                         1.0.0              Common Container Interface (PHP FIG PSR-11)
psr/http-message                      1.0.1              Common interface for HTTP messages
psr/log                               1.1.0              Common interface for logging libraries
psr/simple-cache                      1.0.1              Common interfaces for simple caching
psy/psysh                             v0.9.9             An interactive shell for modern PHP.
ralouphie/getallheaders               2.0.5              A polyfill for getallheaders.
ramsey/uuid                           3.8.0              Formerly rhumsaa/uuid. A PHP 5.4+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).
robrichards/xmlseclibs                3.0.4              A PHP library for XML Security
rollbar/rollbar                       v0.18.2            Monitors errors and exceptions and reports them to Rollbar
sabberworm/php-css-parser             8.1.0              Parser for CSS Files written in PHP
sebastian/code-unit-reverse-lookup    1.0.1              Looks up which function or method a line of code belongs to
sebastian/comparator                  3.0.2              Provides the functionality to compare PHP values for equality
sebastian/diff                        3.0.2              Diff implementation
sebastian/environment                 4.1.0              Provides functionality to handle HHVM/PHP environments
sebastian/exporter                    3.1.0              Provides the functionality to export PHP variables for visualization
sebastian/global-state                2.0.0              Snapshotting of global state
sebastian/object-enumerator           3.0.3              Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector            1.1.1              Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context           3.0.0              Provides functionality to recursively process PHP variables
sebastian/resource-operations         2.0.1              Provides a list of PHP built-in functions that operate on resources
sebastian/version                     2.0.1              Library that helps with managing the version number of Git-hosted PHP projects
seld/jsonlint                         1.7.1              JSON Linter
seld/phar-utils                       1.0.1              PHAR file format utilities, for when PHP phars you up
sentry/sentry                         1.10.0             A PHP client for Sentry (http://getsentry.com)
sentry/sentry-laravel                 0.8.1              Laravel integration for Sentry (https://sentry.io)
staudenmeir/eloquent-json-relations   v1.2.4             Laravel Eloquent relationships with JSON keys
stripe/stripe-php                     v6.31.3            Stripe PHP Library
swiftmailer/swiftmailer               v6.2.0             Swiftmailer, free feature-rich PHP mailer
symfony/console                       v4.2.5             Symfony Console Component
symfony/contracts                     v1.1.6             A set of abstractions extracted out of the Symfony components
symfony/css-selector                  v4.2.5             Symfony CssSelector Component
symfony/debug                         v4.2.5             Symfony Debug Component
symfony/event-dispatcher              v4.2.5             Symfony EventDispatcher Component
symfony/filesystem                    v4.2.5             Symfony Filesystem Component
symfony/finder                        v4.2.5             Symfony Finder Component
symfony/http-foundation               v4.4.1             Symfony HttpFoundation Component
symfony/http-kernel                   v4.2.5             Symfony HttpKernel Component
symfony/mime                          v4.4.1             A library to manipulate MIME messages
symfony/options-resolver              v4.2.5             Symfony OptionsResolver Component
symfony/polyfill-ctype                v1.11.0            Symfony polyfill for ctype functions
symfony/polyfill-iconv                v1.11.0            Symfony polyfill for the Iconv extension
symfony/polyfill-intl-idn             v1.11.0            Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions
symfony/polyfill-mbstring             v1.13.1            Symfony polyfill for the Mbstring extension
symfony/polyfill-php72                v1.11.0            Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions
symfony/process                       v4.2.5             Symfony Process Component
symfony/routing                       v4.2.5             Symfony Routing Component
symfony/translation                   v4.3.4             Symfony Translation Component
symfony/var-dumper                    v4.2.5             Symfony mechanism for exploring and dumping PHP variables
theseer/tokenizer                     1.1.2              A small library for converting tokenized PHP source code into XML and potentially other formats
tijsverkoyen/css-to-inline-styles     2.2.1              CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very useful when you're sending emails.
vlucas/phpdotenv                      v3.3.3             Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.
webmozart/assert                      1.4.0              Assertions to validate method input/output with nice error messages.
webpatser/laravel-uuid                2.2.1              Class to generate a UUID according to the RFC 4122 standard. Support for version 1, 3, 4 and 5 UUID are built-in.
yajra/laravel-datatables-buttons      v4.6.0             Laravel DataTables Buttons Plugin.
yajra/laravel-datatables-html         v4.4.0             Laravel DataTables HTML builder plugin for Laravel 5.4+.
yajra/laravel-datatables-oracle       v9.0.1             jQuery DataTables API for Laravel 4|5
zendesk/zendesk_api_client_php        v2.2.8             PHP Client for Zendesk REST API. See https://developer.zendesk.com/rest_api/docs/core/introduction .
staudenmeir commented 4 years ago

I'm glad you could solve it. Yeah, sounds like a unique issue.