question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Too few arguments to function Illuminate\Database\Eloquent\Relations\HasOneOrMany

See original GitHub issue

Bug report

What I did

Acessed create page from a crud having relation to another object

What I expected to happen

Open the page

What happened

Get this error: Too few arguments to function Illuminate\Database\Eloquent\Relations\HasOneOrMany::__construct(), 0 passed in D:\xampp\htdocs\backpack\vendor\backpack\crud\src\app\Library\CrudPanel\Traits\Relationships.php on line 345 and exactly 4 expected

What I’ve already tried to fix it

Input an attribute named entity in my array

Is it a bug in the latest version of Backpack?

yes, backpack/crud 5.0.3 and backpack/pro 1.0.7

After I run composer update backpack/crud the bug… is it still there? yes

Backpack, Laravel, PHP, DB version

backpack/crud 5.0.3 backpack/pro 1.0.7 Laravel 9.0.2 PHP 8.0.11 DB: Postgresql

When I run php artisan backpack:version the output is: PHP 8.0.11 (cli) (built: Sep 21 2021 18:26:06) ( ZTS Visual C++ 2019 x64 ) Copyright © The PHP Group Zend Engine v4.0.11, Copyright © Zend Technologies

LARAVEL VERSION:

v9.0.2@4c7cd8c4e95d161c0c6ada6efa0a5af4d0d487c9

BACKPACK VERSION:

5.0.3@c14eaca0d10c3a37280786d65cebf735235850d6

image image

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
dilneisscommented, Feb 11, 2022

thanks, problem solved 😃

1reaction
malle-pietjecommented, Feb 11, 2022

Thanks, confirmed this works after running composer update

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type error: Too few arguments to function Illuminate\Database ...
but I want to update if any data found matching with company_profile_id. – Abdus Sattar Bhuiyan · got this error: Call to undefined...
Read more >
Too few arguments to function Illuminate/Database/Eloquent ...
Why am I getting this error? I feel like I'm following all the documentation steps correctly: I have a polymorphic many-to-many relationship: User:...
Read more >
Laravel Error - Call to undefined method Illuminate\Database ...
I got this error today so I am going to tell you how to solve this error in your Laravel project. First of...
Read more >
Uncaught ArgumentCountError: Too few arguments to function ...
Fatal error : Uncaught ArgumentCountError: Too few arguments to function Formater::PostFormater(), 1 passedFatal error : Uncaught ...
Read more >
Laravel Error: Too Few Arguments To Function Illuminate ...
I am getting the following error while trying to insert into the table users_basics. Illuminate\Database\Eloquent\Model::setAttribute(), ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found