F
Filament13mo ago
L!am

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'shipment_items.organization_id' in 'where cl

i have made a shipmentItem migratino, model and a resource when i was finished with the resource the shipmentItem page turned up in my panel but when i click on it i get that error i will add my script in the chat of the migration
No description
20 Replies
L!am
L!amOP13mo ago
<?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { / * Run the migrations. */ public function up(): void { Schema::create('shipment_items', function (Blueprint $table) { $table->id(); $table->foreignId('organization_id'); $table->foreign('organization_id')->references('id')->on('organizations'); $table->foreignId('quotation_orders_id'); $table->foreign('quotation_order_id')->references('id')->on('quotation_orders'); $table->foreignId('order_line_id'); $table->foreign('order_line_id')->references('id')->on('order_lines'); $table->unsignedBigInteger('number')->index(); $table->string('code')->nullable()->index(); $table->unsignedInteger('quantity')->default(0)->nullable(); $table->string('Destination_item'); $table->timestamps(); }); } / * Reverse the migrations. */
public function down(): void { Schema::dropIfExists('shipment_items'); } }; this is my shipment items migration if you need any other scripts just tell me and ill send it
Umar Farooq
Umar Farooq13mo ago
Did you check on the table schema column exists?
L!am
L!amOP13mo ago
kinda new with laravel and filament where can i check that?
Umar Farooq
Umar Farooq13mo ago
open the db on phpMyAdmin etc
L!am
L!amOP13mo ago
im using a localhost db mysql inside vs code the database client extension
Umar Farooq
Umar Farooq13mo ago
do you have mysql workbench?
L!am
L!amOP13mo ago
no the database is on another pc i just got it trough gittyup
Umar Farooq
Umar Farooq13mo ago
okay, did you run artisan migrate?
L!am
L!amOP13mo ago
yes, there was nothing to migrate
Dennis Koch
Dennis Koch13mo ago
As mentioned by Umar: Get a DB tool of your choice and check the actual state of that DB
L!am
L!amOP13mo ago
mysql workbench is good right?
Umar Farooq
Umar Farooq13mo ago
yes
Dennis Koch
Dennis Koch13mo ago
I don't know it. But there are numerous tools out there. Find one that feels good to you. DBeaver, Beestudio, Table Plus, Sequel Ace, ...
L!am
L!amOP13mo ago
oke then ill need to look at yt vid or internet on how i add my database in there there is no way to fix it without mysql workbench?
Dennis Koch
Dennis Koch13mo ago
It's important that you know what you DB looks like. Always. Because otherwise we can't tell whether it's in the state you expect. Also: When debugging it's good to start with a smaller problem. Filament is a complex tool because it's based on Laravel and Livewire. So you need understanding of those too and of PHP and Databases.
L!am
L!amOP13mo ago
why is mysql so weird
Blackpig
Blackpig13mo ago
I don't know the VSCode extension you're using but can you access mysql from your command line? If so DESCRIBE <your_table> will show your table definition
L!am
L!amOP13mo ago
i tried some commands and searching on internet but i don't think thats possible huh i have no clue what i just did but it works i don't get the error anymore and the shipment items panel is working the only thing i did was php artisan tinker now onto fixing this error
Add [name] to fillable property to allow mass assignment on [App\Models\ShipmentItem].
Add [name] to fillable property to allow mass assignment on [App\Models\ShipmentItem].
slowly but surely im starting to understand it more and more
Blackpig
Blackpig13mo ago
Laravel - The PHP Framework For Web Artisans
Laravel is a PHP web application framework with expressive, elegant syntax. We’ve already laid the foundation — freeing you to create without sweating the small things.
L!am
L!amOP13mo ago
thanks ill look into that

Did you find this page helpful?