1

I am absolutely new to laravel. I have an open source laravel application for which I have downloaded the code. I was able to get the home page running using these links:

none of the other webpages are running. I have to manually change the path in the address bar from localhost/public to localhost/public/index.php. Even after this, the webpage that executes, shows no css.If I try to register a user, I get

SQLSTATE[HY000]: General error: 1364 Field 'username' doesn't have a default value

I have referred to the following links in an attempt to solve the issue but no use -

I don't have any data in the database as I cannot understand how to import it. My directory structure is

/var/www/laravelApplicaton
-app/
-artisan
-bootstrap/
-composer.json
-composer.lock
-config/
-database/
-gulpfile.js
-package.json
-phpunit.xml
-public/
-readme.md
-resources/
-routes/
-server.php
-storage/
-tests/
-vendor/

I am using ubuntu 16.04 server; Php7.0.

2
  • I think you need to read the tutorials online and try harder. Please come back when you have a more specific question. Commented Dec 21, 2016 at 4:19
  • @self - can you suggest any particular tutorial? Commented Dec 21, 2016 at 4:24

1 Answer 1

2

OK, you're using Laravel 5.3 as your folder structure shows. There if you closely look there's no any .env file. Do create that because Laravel first seeks for .env file for configurations if that doesn't exists, then it looks for key value pairs in configuration folder i.e config. So if you have got .env file do change database information there or you can change that from /config/database.php. But the good practice is to use .env file on development machine. It's shown here in this link, the way to create .env file:

https://www.rosehosting.com/blog/install-laravel-on-ubuntu-16-04/

And for "username doesn't have a default value" issue, you have not passed value for "username" while inserting, this problem arises if you have username field that can't be null in your database structure.

The best option to play with Laravel is to use composer. Please follow the laravel 5.3 documentation for installation process.

https://laravel.com/docs/5.3/installation

And for beginner Laracast.com have very nice series to get started with Laravel from scratch, I myself have used this tutorial series to get started with laravel.

https://laracasts.com/series/laravel-5-from-scratch/episodes/1

Do check all those episodes out, once you finish you'll be now very much familiar with Laravel.

Hope this helps you.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.