Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on running the php artisan db:seed #2

Closed
gautham718 opened this issue Jul 14, 2017 · 16 comments
Closed

Error on running the php artisan db:seed #2

gautham718 opened this issue Jul 14, 2017 · 16 comments

Comments

@gautham718
Copy link

Hi

I am stuck with the following error on running the php artisan db:seed

[BadMethodCallException]
Call to undefined method Illuminate\Database\Query\Builder::roles()

please help me out to resolve the issue

@bpocallaghan
Copy link
Owner

bpocallaghan commented Jul 14, 2017

Morning @gautham718
Will double check quick.
But I think it is the Models/NavigationAdmin.php - missing relationship.

Give me a couple of minutes...

@bpocallaghan
Copy link
Owner

Hi @gautham718

Please get the latest NavigationAdmin

I am going to download the latest zip and install it to make sure it will work.
Thanks

@gautham718
Copy link
Author

Yes, It worked. Thanks !!!!

And could you please guide me how to configure that to work in a folder inside document root.

http://localhost/addclarity/

Now the folders are listing when i load that URL and if i load http://localhost/addclarity/public/ then CSS and JS missing

@bpocallaghan
Copy link
Owner

Is it on Windows?
If so, are you using wamp or xampp or something else?

I personally use Windows + wamp

If you want - you can send me a mail to help you out in more detail? bpocallaghan @ gmail

@gautham718
Copy link
Author

I am on linux (ubuntu 17.04, php 5.6, mysql 5.7 & apache 2.4)

@bpocallaghan
Copy link
Owner

Setup Virtual Host

The above is for windows - but I think it will push you in the right direction.
I will see if I can find some articles for Linux

@bpocallaghan
Copy link
Owner

@gautham718

This article seems to cover everything.
You will see some similarities between my gist and this article

Article

Please shout if you have any questions.
Unfortunately my Linux knowledge is limited.

@gautham718
Copy link
Author

Thank you so much

@bpocallaghan
Copy link
Owner

bpocallaghan commented Jul 14, 2017

My Pleasure.

All this 'virtual host setup' does is to allow you to enter something like 'addclarity.dev' in your browser and not use localhost/addclarity
This makes it easier to define the 'base' url of your website and not have to worry about css / js not loading as you can just go <img src="/images/myimage.png"/> (to always prefix the '/')

However this does have an effect if you will deploy it to a 'sub folder' on a server, for example it will be example.com/folder instead of example.com - If that makes sense.

The other option is to add a 'base' meta in your head in your html w3schools add base tag
This will allow you to add the base url as 'http://localhost/addclarity/public/' And then the css / js should be without the '/' in front of the path / src of css / js / images.
<img src="/images/myimage.png"/> should become <img src="images/myimage.png"/> when you have the 'base' meta

Will close it in a bit - but please shout when you have any questions / struggle with something.

@gautham718
Copy link
Author

Hi,
Upon setting the Virtual host for addclarity.com the frontend pages are working fine but, when i load http://addclarity.com/admin

the following error is thrown

"Oops - unique url, please fix at TitanAdminController::setselectedNavigation()"

But http://addclarity.com/auth/login is working

@bpocallaghan
Copy link
Owner

bpocallaghan commented Jul 14, 2017

Awesome - hope you like the virtual host setup - Took me a bit to get used to but very nice!

Okys, That is because it did not find any items in the navigation_admin table.

  • Check in your .env file that the APP_URL=http://addclarity.com
  • Have a look at the table - navigation_admin - if there are any entries (if not, run php artisan db:seed again)

That should hopefully fix it (basically its not finding any navigation from the database)

If it does not - go to TitanAdminController::setselectedNavigation() it will be in /vendor/bpocallaghan/titan/src/controllers
and just do a dd($nav) at around here NavigationController

I still need to work a bit on cleaning up the 'titan' package for the 'core / utility classes' :)

Usually the database is empty or the app_url is different from what laravel's request is.
The first two lines in that function
$url = $this->getCurrentUrl(); $sections = $this->getCurrentUrlSections();
Can also just dump them if it does not work to see 'why' it is not matching any navigation on the 'slug'

@gautham718
Copy link
Author

Thanks !! yes, I forgot to change the APP_URL

Thanks again, and sorry for taking your time

@bpocallaghan
Copy link
Owner

Awesome. Glad its working now. Nope, I am just happy that fellow developers are taking an interest in it.
I hope you like it - please shout when you have any questions - happy to help

@gautham718
Copy link
Author

Thanks !!

Is it possible to manage the page content from backend now, I couldn't locate the link for that.

And one more thing, I was not able to log in using the following credentials mentioned in the installation steps.

admin@laravel-admin.com
admin

But this worked

github@bpocallaghan.co.za
github

@bpocallaghan
Copy link
Owner

Thanks for pointing it out - Updated the readme file.
If you look at /database/seeds/UserTableSeeder.php - The initial users gets created from this file (so you can remove all of them and add one for yourself)

Mmmm. Unfortunately not.
This is not a full CMS with a website page builder. You can only manage the navigation (all the urls and html title / description of the page) But you will manually have to create the page yourself.

Might be easier to have a look for yourself.
/routes/web.php - At the top of the file you will see all the urls defined for the Website.
They all link to a Controller - most to /app/Http/Controllers/Website/PagesController

I hope that helps. The page builder is in my todo list tho.
If I understand correctly - you might be more interested into something like Asgard CMS

@gautham718
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants