TO220

TO220

Member Since 2 Years Ago

Experience Points 490
Experience Level 1

4,510 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed 3
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • Chatty Cathy Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

13 May
1 year ago

TO220 left a reply on NPM Issues With Laravel 5.4.21

Well, seem to have had some success. no errors on npm run dev or npm run production anymore.

Steps completed were:

  • Destroy homestead-7 VM
  • Open shell as administrator and run vagrant up
  • Run sudo npm install --no-bin-links twice. First pass fails on stack overflow
  • Run sudo npm install supervisor -g (Not sure if this is necessary)
  • Run sudo npm rebuild node-sass

Yaaaay! Hey zues el saviour what a pain!

04 May
1 year ago

TO220 left a reply on NPM Issues With Laravel 5.4.21

Hmmm, command not found. This is on a fresh laravel homestead install with only npm and node updated.

-bash: webpack: command not found
03 May
1 year ago

TO220 left a reply on NPM Issues With Laravel 5.4.21

Updated npm & node. On fresh vagrant box ran npm install --no-bin-links and still get cross-env: not found. Checking the npm packages and cross-env is installed ok it seems. All of this is inside the vm, nothing done from the windows command line. It seems the cli has no idea where to find the cross-env command listed in the package.json file. Driving me crazy.

Current environment after npm and node update:

Laravel Framework 5.4.21
[email protected]:~/code/app$ npm -v
4.5.0
[email protected]:~/code/app$ node -v
v6.10.2
[email protected]:~/code/app$ exit
logout
Connection to 127.0.0.1 closed.

[email protected] MINGW64 ~/Homestead ((v4.0.5))
$

Current default package.json file:

  "private": true,
  "scripts": {
    "dev": "npm run development",
    "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
    "watch-poll": "npm run watch -- --watch-poll",
    "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
    "prod": "npm run production",
    "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
  },
  "devDependencies": {
    "axios": "^0.15.3",
    "bootstrap-sass": "^3.3.7",
    "cross-env": "^3.2.3",
    "jquery": "^3.1.1",
    "laravel-mix": "0.*",
    "lodash": "^4.17.4",
    "vue": "^2.1.10"
  }
}

Current output of: npm run dev

npm ERR! path /home/vagrant/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/vagrant/package.json'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2017-05-04T02_45_45_138Z-debug.log

npm debug log:

1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'run', 'dev' ]
2 info using [email protected]
3 info using [email protected]
4 verbose config Skipping project config: /home/vagrant/.npmrc. (matches userconfig)
5 verbose stack Error: ENOENT: no such file or directory, open '/home/vagrant/package.json'
5 verbose stack     at Error (native)
6 verbose cwd /home/vagrant
7 verbose Linux 4.4.0-66-generic
8 verbose argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
9 verbose node v6.10.2
10 verbose npm  v4.5.0
11 error path /home/vagrant/package.json
12 error code ENOENT
13 error errno -2
14 error syscall open
15 error enoent ENOENT: no such file or directory, open '/home/vagrant/package.json'
16 error enoent This is most likely not a problem with npm itself
16 error enoent and is related to npm not being able to find a file.
17 verbose exit [ -2, true ]

TO220 left a reply on NPM Issues With Laravel 5.4.21

Thanks jekinney, I have been doing this all in the vm. Havent tried anything from the windows command line, just assumed that was a no no.

TO220 left a reply on NPM Issues With Laravel 5.4.21

Ok, fresh laravel install. Ran npm install --no-bin-links. No love... still get cross-env: not found.

Output of npm install cross-env:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-66-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "cross-env"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! path ../cross-env/dist/bin/cross-env.js
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink

npm ERR! EPROTO: protocol error, symlink '../cross-env/dist/bin/cross-env.js' -> '/home/vagrant/code/app/node_modules/.bin/cross-env'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/code/app/npm-debug.log

Output of npm run dev:


> @ dev /home/vagrant/code/app
> npm run development


> @ development /home/vagrant/code/app
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

sh: 1: cross-env: not found

npm ERR! Linux 4.4.0-66-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "development"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/code/app/npm-debug.log

npm ERR! Linux 4.4.0-66-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/code/app/npm-debug.log

TO220 left a reply on NPM Issues With Laravel 5.4.21

Tried this on a fresh laravel installation, still no go. Keep getting the cross-env: not found error.

TO220 left a reply on NPM Issues With Laravel 5.4.21

Have done that, but still no love. Output is listed above.

TO220 started a new conversation NPM Issues With Laravel 5.4.21

Hello, fresh fresh newb and hitting an issue with NPM. Am unable to run:

npm run dev

I'm on Windows 7 with virtual box and vagrant homestead. I have seen and tried several fixes for this issue relating to cross-env locations but those no longer seem to work. It appears the package.json file has changed recently. Any help or ideas would be greatly appreciated!

My versions are:

[email protected] MINGW64 ~/Homestead ((v4.0.5))
[email protected]:~/code/app$ php artisan --version
Laravel Framework 5.4.21
[email protected]:~/code/app$ laravel -v
Laravel Installer 1.3.5
[email protected]:~/code/app$ node -v
v6.10.2
[email protected]:~/code/app$ npm -v
3.10.10

NPM install output:

npm WARN deprecated [email protected]: Use uuid module instead
/home/vagrant/code/app
├── [email protected]  extraneous
├── [email protected]  extraneous
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected]
├── [email protected]  extraneous
├── [email protected]  extraneous
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ ├─┬ [email protected]
│ │ │ ├── [email protected]
│ │ │ └── [email protected]
│ │ ├─┬ [email protected]
│ │ │ └── [email protected]
│ │ └─┬ [email protected]
│ │   └── [email protected]
│ └── [email protected]
├── [email protected]
├── lodash[email protected]
└── [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected]^1.0.0 (node_modules/chokidar/node_modules/fsevents        ):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin"        ,"arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.4.0-66-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! path ../acorn/bin/acorn
npm ERR! code EPROTO
npm ERR! errno -71
npm ERR! syscall symlink

npm ERR! EPROTO: protocol error, symlink '../acorn/bin/acorn' -> '/home/vagrant/code/app/node_modules/.bin/a        corn'
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/code/app/npm-debug.log```

npm run dev output:

```[email protected]:~/code/app$ npm run dev

> @ dev /home/vagrant/code/app
> npm run development


> @ development /home/vagrant/code/app
> cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node        _modules/laravel-mix/setup/webpack.config.js

sh: 1: cross-env: not found

npm ERR! Linux 4.4.0-66-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "development"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hid        e-modules --config=node_modules/laravel-mix/setup/webpack.config.js`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack        .js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --        config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/code/app/npm-debug.log

npm ERR! Linux 4.4.0-66-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev"
npm ERR! node v6.10.2
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/vagrant/code/app/npm-debug.log```



15 Apr
2 years ago

TO220 left a reply on Logic On HasMany Foreign Key Match

Alright, my problem was slightly more complicated than posted but here is the solution that ended up working for me thanks to Snapey!

//So in my anotherModel class I had other hasMany relationship's setup and of course
//    a hasMany relationship setup in 'model'

//This is what worked for me:
$collection = $model->with(['anotherModel' => function($query) use ($someVar){
                                                                                return $query->where('columnID', '&', '$someVar');},
                                                 'anotherModel.anotherTable', 'anotherModel.yetAnotherTable'])
                                 ->where('someColumn', $anotherVar)
                                 ->where('anotherColumn', $yetAnotherVar)
                                 ->get();

Thank you Snapey! I really appreciate your help!

05 Apr
2 years ago

TO220 left a reply on Logic On HasMany Foreign Key Match

Thank you Snapey! I was thinking a closure may be the route to take, but I have never actually used them and wasn't quite sure how to use them with eloquent. Thank you! I will give this a go : )

04 Apr
2 years ago

TO220 started a new conversation Logic On HasMany Foreign Key Match

Using Eloquent stand alone on a script and am pulling from a table with a hasMany on another table. For example:

$collection = $model->with('anotherModel')
                     ->where('columnName', $someVar)
                     ->get();

But, on anotherModel I need to do some logic on the match. It is not a straight foreign key match with $someVar. I need to 'AND' $someVar with the foreign key to get a match. Is something like this possible? Like a:

$collection = $model->with('anotherModel', 'where' '$somVar' 'AND' 'foreignKey')
                     ->where('columnName', $someVar)
                     ->get();