Dale
Dale
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
🙂
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
Matthew, you are a beautiful person. Thank you for your assistance. This was in fact the issue!!
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
The migration file I listed was generated by Blueprint but the donationtype_id constrained seems to be formatted with a ('') whereas the donor_id is not.
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
No description
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
Sorry I'm an idiot, I opened the migration but copied the model. <?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::disableForeignKeyConstraints(); Schema::create('donations', function (Blueprint $table) { $table->id(); $table->foreignId('donor_id')->constrained(); $table->dateTime('date'); $table->decimal('amount', 8, 2); $table->boolean('recurring')->default(false); $table->text('notes')->nullable(); $table->foreignId('donationtype_id')->constrained(''); $table->timestamps(); $table->softDeletes(); }); Schema::enableForeignKeyConstraints(); } / * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('donations'); } };
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
I added it just before the screenshot of the Create Donation form.
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
I used Blueprint package to generate my models and migration files.
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
In my example both the donor_id and donationtype_id point to valid records in the associated tables. I have written plenty of Laravel code over the past 4 years but for the life of me I cant see what I missed.
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
No description
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
No description
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
<?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\SoftDeletes; class Donation extends Model { use HasFactory, SoftDeletes; protected $casts = [ 'id' => 'integer', 'donor_id' => 'integer', 'date' => 'datetime', 'amount' => 'decimal:2', 'recurring' => 'boolean', 'donationtype_id' => 'integer', ]; public function donor(): BelongsTo { return $this->belongsTo(Donor::class); } public function donationtype(): BelongsTo { return $this->belongsTo(Donationtype::class); } }
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
I have now corrected the case of the Model names (thank you both).
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
I just discovered that even from Tinker I can't insert a new record but can for other tables. I assume that this means I have an issue somewhere between the model and the table in the DB. When I tried to DB::table("Donations")->insert([....... it failed in the same way.
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
No description
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
The donations Listing View is from the manually inserted DB rows and uses the same Model.
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
No description
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
Illuminate\Database\QueryException SQLSTATE[HY000]: General error: 1 no such table: main. (Connection: sqlite, SQL: insert into "donations" ("donor_id", "date", "amount", "recurring", "notes", "donationtype_id", "updated_at", "created_at") values (1, 2025-04-07 10:49:14, 1, 0, ?, 1, 2025-04-07 17:49:25, 2025-04-07 17:49:25))
31 replies
FFilament
Created by Dale on 4/7/2025 in #❓┊help
Resource > Page > Create fails
Here is the full text and I'm not sure if this is a Filament, Livewire or Laravel issue.
31 replies