lara-zeus / sky

CMS for your website. it include posts, pages, tags, and categories. with a frontend scaffolding ready to use
https://larazeus.com/sky
MIT License
136 stars 25 forks source link

[Bug]: could not find driver error #161

Closed TapanDerasari closed 11 months ago

TapanDerasari commented 11 months ago

What happened?

As #158 explain here, when I try to open the posts, pages

could not find driver CREATE TABLE "post_statuses" ("id" integer PRIMARY key autoincrement NOT NULL, "name" varchar, "label" varchar, "class" varchar, "icon" varchar)

How to reproduce the bug

Fresh installation of latest laravel 10.x and filament 3.x

then install the lara-zeus/sky

try to access urls: admin/posts/ admin/pages/

Package Version

3.1.3

PHP Version

8.2.7

Laravel Version

10.24.0

Which operating systems does with happen with?

Linux

Notes

I did enabled the redis-ext but still no luck.

Any help or suggestion would be great :)

atmonshi commented 11 months ago

if you print out phpinfo(); in any page index.php for example

do you see the redis-ext ?

restarted apache or nginx ?

badrshs commented 11 months ago

got same error yesterday on v2

atmonshi commented 11 months ago

I am using

https://github.com/calebporzio/sushi

How It Works Under the hood, this package creates and caches an SQLite database JUST for this model. It creates a table and populates the rows. If for whatever reason, it can't cache a .sqlite file, it will default to using an in-memory sqlite database.

check this also https://github.com/lara-zeus/bolt/issues/140#issuecomment-1688156159

maybe its folders permissions

atmonshi commented 11 months ago

@badrshs

got same error yesterday on v2

was it a fresh installation or an upgrade?

TapanDerasari commented 11 months ago

if you print out phpinfo(); in any page index.php for example

do you see the redis-ext ?

restarted apache or nginx ?

Yes it shows the redis as enabled

atmonshi commented 11 months ago

if you can install and use sushi

in your app without sky and see if it runs fine?!

hard for me to debug...

operating system PHP version what extension you enable in php apache or nginx folders permissions other packages

TapanDerasari commented 11 months ago

@atmonshi thanks for the suggestion I tried the Sushi in fresh installation of laravel 10.x and separate project with Sky,

It creates the sushi model files and the sushi-lara-zeus-sky-models-post-status.sqlite. but still no luck.

Operating System: Ubuntu PHP 8.2 Apache with folder permission of 777

badrshs commented 11 months ago

Hi guys, Im getting same issue as reported but I'm on windows and I use mysql as normal and fresh project ..

you guys are talking on the redis , why I would even need that ? can't see at least anything in the documentation talking about it ..

atmonshi commented 11 months ago

@badrshs

I am using

https://github.com/calebporzio/sushi

How It Works Under the hood, this package creates and caches an SQLite database JUST for this model. It creates a table and populates the rows. If for whatever reason, it can't cache a .sqlite file, it will default to using an in-memory sqlite database.

check this also lara-zeus/bolt#140 (comment)

maybe its folders permissions

TapanDerasari commented 11 months ago

@atmonshi @badrshs

I did installed the Sushi, it seems like Now I can access the posts, pages etc...

But when there are no records in every resources navigation was working fine but after creation of one post, posts.index is inaccessible .

It gives Route [post] not defined.

atmonshi commented 11 months ago

@TapanDerasari can you share your config from adminPanelProvider

also run php artisan route:list to see if sky routes registered or not

TapanDerasari commented 11 months ago

@atmonshi Here is adminPanelProvider file that I configure after reviewing your demo app code.

AdminPanelProvider.php $panel->plugins($this->getPlugins());

public function getPlugins(): array
    {
        return [
            SpatieLaravelTranslatablePlugin::make()
                ->defaultLocales(['en']),
            FilamentNavigation::make(),
            SkyPlugin::make(),
        ];
    }

and here is the route list result of posts routes

GET|HEAD   admin/posts ........................................................... filament.admin.resources.posts.index › LaraZeus\Sky › ListPosts
  GET|HEAD   admin/posts/create .................................................. filament.admin.resources.posts.create › LaraZeus\Sky › CreatePost
  GET|HEAD   admin/posts/{record}/edit ............................................... filament.admin.resources.posts.edit › LaraZeus\Sky › EditPost

Create and Edit pages are working but listing page of posts,library and pages not working.

Let me know if anything else requires..

atmonshi commented 11 months ago

Do you have more than one panel? if so, try to add SkyPlugin::make(), to the other plugins for testing.

Can you check the file in your vendor folder? and it is the same as: https://github.com/lara-zeus/sky/blob/3.x/routes/web.php

and here is the route list result of posts routes

You should see something like: GET|HEAD sky/post/{slug} ............................................................ post › LaraZeus\Sky › Post

TapanDerasari commented 11 months ago

Yes, I do have multiple panel and after adding the plugin code to the another panel It did started working.

also yes, both web.php files are identical.

In the route list now there are routes that you mentioned.

But I think this is a bug bcz I don't need the plugin functionality into my another panel. :)

atmonshi commented 11 months ago

yes, I will find a better way to handle the routes for the frontend, that is way I asked about the panels I may add config file for the frontend options.

will be fixed in few days thank you for the time to check this :)

atmonshi commented 11 months ago

New release to address the configuration for multiple panels. I hope this will fix any issues. Anyone facing new issues, please feel free to open new one :)

Thank you for using Sky.