Jocka
Jocka
Explore posts from servers
FFilament
Created by Jocka on 5/30/2025 in #❓┊help
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in order clause is ambiguo
select
`user_watched_lectures`.`user_id` as `pivot_user_id`,
`user_watched_lectures`.`lecture_id` as `pivot_lecture_id`,
`user_watched_lectures`.`created_at` as `pivot_created_at`,
`user_watched_lectures`.`updated_at` as `pivot_updated_at`,
`user_watched_lectures`.*,
`lectures`.*
from
`lectures`
inner join `user_watched_lectures` on `lectures`.`id` = `user_watched_lectures`.`lecture_id`
where
`user_watched_lectures`.`user_id` = 1
order by
`user_watched_lectures`.`id` desc,
`order` asc,
`created_at` asc
limit
10 offset 0
select
`user_watched_lectures`.`user_id` as `pivot_user_id`,
`user_watched_lectures`.`lecture_id` as `pivot_lecture_id`,
`user_watched_lectures`.`created_at` as `pivot_created_at`,
`user_watched_lectures`.`updated_at` as `pivot_updated_at`,
`user_watched_lectures`.*,
`lectures`.*
from
`lectures`
inner join `user_watched_lectures` on `lectures`.`id` = `user_watched_lectures`.`lecture_id`
where
`user_watched_lectures`.`user_id` = 1
order by
`user_watched_lectures`.`id` desc,
`order` asc,
`created_at` asc
limit
10 offset 0
5 replies
FFilament
Created by Jocka on 5/30/2025 in #❓┊help
SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'created_at' in order clause is ambiguo
for some reason the query is still sent like this
5 replies
FFilament
Created by Jocka on 11/27/2024 in #❓┊help
Relationship manager not showing attribute.
No description
6 replies
FFilament
Created by Jocka on 11/27/2024 in #❓┊help
Relationship manager not showing attribute.
when i dd this in the resource
dd(CourseBundle::with('courses')->get()->toArray());
dd(CourseBundle::with('courses')->get()->toArray());
6 replies
FFilament
Created by Jocka on 11/27/2024 in #❓┊help
Relationship manager not showing attribute.
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class CourseBundle extends Model
{
use HasFactory;

protected $guarded = ['id'];

public function courses(): BelongsToMany
{
return $this->belongsToMany(Course::class, 'course_course_bundles', 'course_bundle_id', 'course_id')
->withTimestamps();
}
}
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;

class CourseBundle extends Model
{
use HasFactory;

protected $guarded = ['id'];

public function courses(): BelongsToMany
{
return $this->belongsToMany(Course::class, 'course_course_bundles', 'course_bundle_id', 'course_id')
->withTimestamps();
}
}
6 replies
FFilament
Created by Jocka on 11/27/2024 in #❓┊help
Relationship manager not showing attribute.
And here is the CourseBundle model
6 replies