bpocallaghan / laravel-admin-starter

A Laravel Admin Starter project with Page Builder, Roles, Impersonation, Analytics, Blog, News, Banners, FAQ, Testimonials and more
http://bpocallaghan.co.za
337 stars 92 forks source link

Error on running the php artisan db:seed #2

Closed gautham718 closed 7 years ago

gautham718 commented 7 years ago

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 commented 7 years ago

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

Give me a couple of minutes...

bpocallaghan commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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

bpocallaghan commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

Thank you so much

bpocallaghan commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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.

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 commented 7 years ago

Thanks !! yes, I forgot to change the APP_URL

Thanks again, and sorry for taking your time

bpocallaghan commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

Thanks