HansSchouten / Laravel-Pagebuilder

A drag and drop pagebuilder to manage pages in any Laravel project
https://www.phpagebuilder.com
MIT License
783 stars 182 forks source link

Getting a Page not found #7

Closed williamengbjerg closed 4 years ago

williamengbjerg commented 4 years ago

I followed the instructions - installed on a new laravel project. But I keep getting a "Page not found" when trying to enter /admin page.

Also edited the pagebuilder.php - I'm I missing someting?:/

HansSchouten commented 4 years ago

The steps in the readme should be sufficient. Are you using the latest release? It should work even without editing the config file. Are you accessing /admin via a sub directory or is it installed in the root directory of your domain?

williamengbjerg commented 4 years ago

@HansSchouten - Thanks for reply. I've been following the steps up to several times:/ I don't see any existing admin folders or in the routes. When using Laravel I just get a blank page on the main page and the error when typing /admin.

I did install laravel/ui with vue. Could that have any conflicts when integrating the pagebuilder?

HansSchouten commented 4 years ago

Could you check if you manage to get it working in a clean Laravel installation to see whether the laravel/ui and vue is the issue? I do not have an environment where I use it with the packages you mention.

williamengbjerg commented 4 years ago

@HansSchouten I just installed a clean laravel installation without any auth packages. And followed this laravel-pagebuilder guide. Got the blank page and Page not found again. Is it required to also follow the Pagebuilder steps?

Btw: I'm using PHP version 7.4.2 (Could that have any effect using the project)?

Screenshot_1

HansSchouten commented 4 years ago

Strange, I just added it to a clean Laravel installation and everything works fine (PHP 7.3.7). I only followed the instructions in the Readme.

I see you are testing in a Windows environment, so maybe there is an issue with paths that I do not have on linux. Could you go to vendor/hansschouten/phpagebuilder/src/Core/helpers.php and print the outputs of the calls to phpb_in_module() and phpb_on_url()?

williamengbjerg commented 4 years ago

Strange. I can try to run the install on my mac tomorrow. All tho I Mainly use my PC.

Output on /admin - phpb_on_url() seems to be empty:
image

HansSchouten commented 4 years ago

Ok, so the $currentUrl here should not have been /, but /admin. Then it would have matched with the website manager module's URL and have shown you the admin area.

Since $currentUrl is incorrect, the issue would be in the definition of phpb_current_url(). Could you check the variables in that method? I guess something is wrong with extracting the $baseDirectory in phpb_current_url().

williamengbjerg commented 4 years ago

Yup. Is this the correct output?

image

AMB85 commented 4 years ago

I am not sure if my issue is related or not. I have a clean Laravel build but running on Linux. I can get to /admin but when you put in the credentials it goes to /admin/auth?action=login and I get no page found.

HansSchouten commented 4 years ago

So according to that output, $baseDirectory (PHP_SELF) does not contain the path relative to the domain you are trying to access, but instead it contains the entire local path. That is different from what I expected from the PHP docs: afbeelding I will create a fix for it.

williamengbjerg commented 4 years ago

@HansSchouten Sounds good. I'll be ready to test it:)

HansSchouten commented 4 years ago

Thanks for your patience and helping to make this project better! I just made a new release which (among other fixes) does no longer rely on PHP_SELF. Could you try a new installation with v0.9.0?

williamengbjerg commented 4 years ago

@HansSchouten It works ! Looks pretty cool. I'm gonna test and try it:)

HansSchouten commented 4 years ago

Great! If you have any questions feel free to create a ticket, as the project is still in its early stages and documentation/demo content is far from perfect. FYI, you might encounter a loading issue if you are using Chrome by any chance. I am working on that.