filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.07k stars 2.82k forks source link

Tenancy -> RelationManager : General error: 1364 Field 'team_id' doesn't have a default value #7511

Closed aeq-dev closed 1 year ago

aeq-dev commented 1 year ago

Package

filament/filament

Package Version

v3.0.8

Laravel Version

v10.7.1

Livewire Version

v^3.0

PHP Version

PHP 8.1.20

Problem description

I'm trying to add a child using RelationManager, so I didn't set the parent_id neither the team_id, so on create action I get this error : General error: 1364 Field 'team_id' doesn't have a default value

Expected behavior

the child object should be created with auto filling parent_id (it's okey) and team_id (failed)

Steps to reproduce

  1. Setup tenancy
  2. Create resource parent
  3. Create Relation Manager for child
  4. create a child under parent section
  5. set child form attributes without parent selection nor team selection (should be added automatically)
  6. save data
  7. The error appears

Reproduction repository

https://github.com/filamentphp/filament

Relevant log output

No response

github-actions[bot] commented 1 year ago

Hey @aeq-dev! We're sorry to hear that you've hit this issue. 💛

However, it looks like you forgot to fill in the reproduction repository URL. Can you edit your original post and then we'll look at your issue?

We need a public GitHub repository which contains a Laravel app with the minimal amount of Filament code to reproduce the problem. Please do not link to your actual project, what we need instead is a minimal reproduction in a fresh project without any unnecessary code. This means it doesn't matter if your real project is private / confidential, since we want a link to a separate, isolated reproduction. That would allow us to download it and review your bug much easier, so it can be fixed quicker. Please make sure to include a database seeder with everything we need to set the app up quickly.

aeq-dev commented 1 year ago

Hi, here's the the reproduction repository url issue-7511