Fix: resolve database migration and model inconsistencies

This commit is contained in:
Lutfi Hakim 2026-04-30 07:30:54 +07:00
parent 56e69bd01d
commit 5f8202e7ca
3 changed files with 4 additions and 5 deletions

View File

@ -11,7 +11,7 @@ public function index()
// Menampilkan 4 buku rilis baru berdasarkan tahun terbit terbaru
$bukuTerbaru = \App\Models\Buku::whereNotNull('tahun_terbit')
->orderBy('tahun_terbit', 'desc')
->orderBy('id_buku', 'desc')
->orderBy('id', 'desc')
->limit(4)
->get();

View File

@ -9,8 +9,8 @@ class Buku extends Model
{
use HasFactory;
protected $table = 'buku';
protected $primaryKey = 'id_buku';
protected $table = 'bukus';
protected $primaryKey = 'id';
protected $fillable = [
'bibid',

3
package-lock.json generated
View File

@ -1,10 +1,9 @@
{
"name": "perpustakaan",
"name": "Sarakata-Perpustakaan-Daerah-Jember",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "perpustakaan",
"devDependencies": {
"@tailwindcss/forms": "^0.5.2",
"@tailwindcss/vite": "^4.0.0",