F
Filament12mo ago
Anwar

help

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'title' in 'field list' how migrate the column
46 Replies
KA
KA12mo ago
Can you post your posts migration?
Anwar
AnwarOP12mo ago
how please?
DrByte
DrByte12mo ago
Did you create and run a migration for the Post model in your Laravel app?
Anwar
AnwarOP12mo ago
yes but when add title no column
BJ
BJ12mo ago
define it in post model protect $fillable
Anwar
AnwarOP12mo ago
how
DrByte
DrByte12mo 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.
BJ
BJ12mo ago
can u take screenshot for ur post model and ur migration
Anwar
AnwarOP12mo ago
this
BJ
BJ12mo ago
migration?
Anwar
AnwarOP12mo ago
this?
BJ
BJ12mo ago
this model go to migration file
Anwar
AnwarOP12mo ago
sorry
BJ
BJ12mo ago
there is no title here check ur table in db is there title?
Anwar
AnwarOP12mo ago
no
BJ
BJ12mo ago
the table has only id and timestamp for sure will not match u puted values in ur model but it not match with ur current table
Anwar
AnwarOP12mo ago
yah how can add title ?
BJ
BJ12mo ago
make new migration in posts table and put all fields or go direct to db posts table add new row title and check is same error or become slug not found
Anwar
AnwarOP12mo ago
php artisan make:model Post -m like this?
BJ
BJ12mo ago
php artisan make:migration update_posts_table
Anwar
AnwarOP12mo ago
ok
BJ
BJ12mo ago
Schema::table('posts', function (Blueprint $table) { $table->string('title'); }); add slogs too color content same as fillable
Anwar
AnwarOP12mo ago
where
BJ
BJ12mo ago
Schema::table not create u have it already
Anwar
AnwarOP12mo ago
😭
BJ
BJ12mo ago
ضبط؟
Anwar
AnwarOP12mo ago
لا لو احذف المودل وارجعه يضبط؟
BJ
BJ12mo ago
تقدر تحذف الميقرشن والمودل وتحذف الجدول في الداتا بيس وتبنيه من جديد لو تبني ميقريشن اول شي افضل
Anwar
AnwarOP12mo ago
daar
daar12mo ago
Hi Anwar, you need the schema in the migration file, not in the model file
Anwar
AnwarOP12mo ago
this migration can i remove it?
daar
daar12mo ago
GitHub
erpsaas/app/Models/User.php at ec56e8ece6000fbe3faeddf59a7d81a44e72...
Contribute to andrewdwallo/erpsaas development by creating an account on GitHub.
Anwar
AnwarOP12mo ago
هنا
daar
daar12mo ago
notice name in the model file in the array $fillable and the corresponding schema definition : $table->string('name');
BJ
BJ12mo ago
لا احذف الي جوه بنلاقي فيه واحد خاص posts
Anwar
AnwarOP12mo ago
هنا بس ضايفه id
BJ
BJ12mo ago
لا ذا سويه في الميقرش مو موجل احذف الملف وسوي واحد ثاني
Anwar
AnwarOP12mo ago
جالسة احذف الي على جنب
BJ
BJ12mo ago
واحذف الجدول الي في قاعده البيانات الي اسمه post واتشغل مره ثاني عشان يوضح لك
Anwar
AnwarOP12mo ago
بحاول الحين شكرا
BJ
BJ12mo ago
كليك يمين وسوي ديليت وبرضه من قواعد البيانات سوي ميقريشن ثاني وضيفي كل الحقول مو بس id and timestamp add title content any
Anwar
AnwarOP12mo ago
الحين بجرب ان شاءالله
KA
KA12mo ago
@BJ please dont fix him, he will never learn. Let him learn laravel properly. That will help him in future.
BJ
BJ12mo ago
ok my bad im just telling that model has some attributues not iin migration or db table
KA
KA12mo ago
he has no idea about migration or model properly. he might seen some video tutorial and start working without proper learning. you can help him with some good guideline in private.
Want results from more Discord servers?
Add your server