Why does "http://blog.dev/" not show the new app?

Published 3 weeks ago by kvnkrft

Hi all,

I am just working on #3 of the Laravel 5.4 From Scratch series.

When I go to "blog.dev" I get a 1 line output of "It works!" but not the actual page that's in the video.

Any thoughts as to why this could be happening? I did set /code to "park" and I did create the blog all in /code. I also can't seem to use "php artisan serve" anymore.

Kevins-MBP:code kevin$ php artisan serve
Could not open input file: artisan

I swear php artisan used to work before installing valet.

Thanks in advance,

Kevin

mattwmatt

You need to cd into the blog folder where the project was created.

There should be an artisan file there.

Looks like your project is located at:

cd ~/code/blog
kvnkrft

Hi @mattwmatt,

Thanks for taking your time to help.

I'm in the /code/blog directory - so strange.

Kevins-MBP:blog kevin$ pwd
/Users/kevin/code/blog
Kevins-MBP:blog kevin$ php artistan -v
Could not open input file: artistan
Kevins-MBP:blog kevin$ ls -l
total 768
drwxr-xr-x   7 kevin  staff     238 21 Nov 11:42 app
-rw-r--r--   1 kevin  staff    1686 21 Nov 11:42 artisan
drwxr-xr-x   4 kevin  staff     136 21 Nov 11:42 bootstrap
-rw-r--r--   1 kevin  staff    1379 21 Nov 11:42 composer.json
-rw-r--r--   1 kevin  staff  139167 21 Nov 11:42 composer.lock
drwxr-xr-x  13 kevin  staff     442 21 Nov 11:42 config
drwxr-xr-x   6 kevin  staff     204 21 Nov 11:42 database
-rw-r--r--   1 kevin  staff    1125 21 Nov 11:42 package.json
-rw-r--r--   1 kevin  staff    1040 21 Nov 11:42 phpunit.xml
drwxr-xr-x   8 kevin  staff     272 21 Nov 11:42 public
drwxr-xr-x   5 kevin  staff     170 21 Nov 11:42 resources
drwxr-xr-x   6 kevin  staff     204 21 Nov 11:42 routes
-rw-r--r--   1 kevin  staff     563 21 Nov 11:42 server.php
drwxr-xr-x   5 kevin  staff     170 21 Nov 11:42 storage
drwxr-xr-x   6 kevin  staff     204 21 Nov 11:42 tests
drwxr-xr-x  37 kevin  staff    1258 21 Nov 11:42 vendor
-rw-r--r--   1 kevin  staff     549 21 Nov 11:42 webpack.mix.js
-rw-r--r--   1 kevin  staff  226573 21 Nov 11:42 yarn.lock

Thoughts?

Kevin

mattwmatt

You're spelling it wrong?

artistan

should be:

artisan

only 1 't'.

Your first post, you spelled it correct, so if this does not work, someone else may need to provide some suggestions.

kvnkrft

Okay,

I've got "php artisan serve" working (going forward I will look at my spelling more). But I still can't get to blog.dev but I can get to http://127.0.0.1:8000/.

I'm not sure, but I think "valet" is supposed to map http://127.0.0.1:8000/ to blog.dev.

Kevin

mattwmatt

artisan serve and laravel valet are 2 different things.

At least we know artisan is working,

To get blog.dev make sure you have followed the valet installation instructions.

https://laracasts.com/series/setup-a-mac-dev-machine-from-scratch/episodes/10

https://laravel.com/docs/5.5/valet

kvnkrft

Hi @mattwmatt,

Thank you. Sounds good. I'm just trying to follow the videos but keep on running into problems. I'll try to battle through one at a time.

Kevin

JeffBeltran

@kvnkrft what os are you on?

kvnkrft

@JeffBeltran I'm on Mac OS X.

Kevins-MBP:~ kevin$ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.6
BuildVersion:   16G29
mattwmatt

I'm no expert on Valet, but it has been fairly simple for me in the past.

Once installed and you park valet on a folder (such as ~/code).

All folders directly inside that folder can be used with the .dev tld (such as blog.dev if to project is at ~/code/blog).

Sorry, I cannot help more than that.

I am not on my mac at the moment, so cannot test, but try seeing what valet commands are available. I think there is one that will list all domains that it has generated from the parked folder.

JeffBeltran

It sounds like you want to use valet but you are using the built in serve command.

The artisan serve command will only run the project via the url it gives you. For example on my machine after you run php artisan serve you would see Laravel development server started: <http://127.0.0.1:8000> so i wouldn't go to http://blog.dev i would go to http://127.0.0.1:8000

But if you want to use blog.dev then you would need to setup valet like @mattwmatt said. Read and follow all the steps on https://laravel.com/docs/5.5/valet#installation and you should be up and running. But make sure you READ all of the steps. If you still can't get it to work you should be getting an error and we'll need that to help you more

kvnkrft

Hi @mattwmatt, it's strange. I've followed everything in the video and clearly valet is doing something, otherwise, I wouldn't be seeing the "It works!" message when I visit blog.dev. And it looks like valet knows about my directory:

Kevins-MBP:~ kevin$ valet paths
[
    "/Users/kevin/code"
]

But this leads me to believe that "park" somehow didn't work:

Kevins-MBP:~ kevin$ valet links
+------+-----+-----+------+
| Site | SSL | URL | Path |
+------+-----+-----+------+
shez1983

try going into the directory where your project is and do valet link (in this case should be blog ie valet link blog..

kvnkrft

@shez1983 thank you. I think there's progress, but it's still only showing "It works!" in the browser.

Kevins-MBP:blog kevin$ valet link
Password:
A [blog] symbolic link has been created in [/Users/kevin/.valet/Sites/blog].
Kevins-MBP:blog kevin$ valet links
+------+-----+-----------------+------------------------+
| Site | SSL | URL             | Path                   |
+------+-----+-----------------+------------------------+
| blog |     | http://blog.dev | /Users/kevin/code/blog |
+------+-----+-----------------+------------------------+
Kevins-MBP:blog kevin$ valet restart
Restarting php71...
Restarting nginx...
Valet services have been restarted.
Kevins-MBP:blog kevin$

Please sign in or create an account to participate in this conversation.