1

I'm new with laravel and I'm not really sure if I explained the problem properly. The things is, it was given to me the code from an already existing website to upgrade it visually. But i can't make the visual part of the website work.
I started by checking if it was because i was opening the file instead of using localhost, because its a common mistake, but I was doing it right.
So I'll add an image to show what's my problem

enter image description here

Hope someone can help me, Thanks in advance

7
  • did you install laravel? which means, did you do composer install, npm install , changed your .env file Commented Feb 23, 2017 at 11:14
  • i did install the laravel, i didn't changed the .env file because it isn't there. The project wasn't created by me, they just passed me their code, so this is quite messy for me Commented Feb 23, 2017 at 11:18
  • if your .env file isn't there, create it . generate a key with : php artisan key:generate and change the values in your .env file to match your database Commented Feb 23, 2017 at 11:21
  • That's the problem, i don't know anything about the database. I'm an intern right now and they asked me to make the content of this section of their website acording to the their norms ( Visual upgrade it basically), I expected to only work with their css, but considering your answer, i tried ot generate a key through cmd and doesn't work, should i use the composer? Commented Feb 23, 2017 at 11:34
  • I provided an answer with the basic contents of the .env file. And since you are an intern just ask your boss for the database settings. Commented Feb 23, 2017 at 11:35

3 Answers 3

2

You need to save the php file as NAMEHERE.blade.php Read more here https://laravel.com/docs/5.4/blade

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

11 Comments

I did read the documentation but didn't understand completely, if you are saying that the Views need to be saved as FILENAME.blade.php I already did that, I remember that I need to change the name of the php.ini-production/documentation to only php.ini, not sure if that's very important though
You need to be running the laravel project either with php artisan:serve or xampp or something.If you're using xampp,or some sort you need to access it like this : localhost/projectname/public , if you're using php artisan serve localhost:8000
Im using wamp to run the project, the url Im using to open it is localhost/projectname/resources/views/layouts/master.blade.php, which as the code for the general layout of the website
Laravel uses routing do know what action to do and what to return to you. Also you have blade that does an template engine to that. That seems to be a template layout, so you should go to : localhost/projectname/public and from there on you're actually loading the php
It seems that there isn't a public folder inside the project, is it a possible reason to make it not work?
|
0

It seems that you missed extension of view file.

It should be filename.blade.php

1 Comment

This is the page with the code to the general website layout, do i still need to extend it? For example, the page for new orders has the @extends('layouts.master') line to extend the layout of the homepage to it
0

Based on the screenshot of your folder structure provided in the comments: http://prnt.sc/ecd1hf .

You are missing an .env file

So create the .env file in the root of your project. The contents of a basic .env file for laravel 5.4 and run the following command to generate a key:

php artisan key:generate 

you will also need to add your database info and any other important info in this file.

Also make sure Composer/npm/... is installed correctly

  1. First run: Composer install
  2. After that: npm install (since i did not see a yarn.lock file)
  3. i noticed a gulpfile.js so make sure to run gulp after you installed npm, the command for this is: gulp

4 Comments

Based on your first answer, I checked the folder and all the visual content is placed in a img folder on project/resources/assets, maybe that's suposed to be the database
no no, thats all correct. assets contains your css/js/images etc . Your database will be seperate from your project . you have to have credentials to log into it. those credentials need to be placed inside your .env file. You will need to ask for those credentials to your boss or co-worker
Ok, I'll do that. Hopefully when I connect the database to the project It finally shows the visual part of the website. Thank you!
the database is not responsible for that, but the .env is necessarry . i'll add the steps after that too. I noticed you have gulpfile.js in your project which means you need to also run gulp for the assets to compile correctly. i'll edit my answer

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.