anpel

anpel

Member Since 2 Years Ago

Experience Points 340
Experience Level 1

4,660 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 0
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.

28 Jun
10 months ago

anpel left a reply on How To Escape Double Curly Braces In A Blade Template?

I have no idea what project I needed this for or what I ended up doing. I will try to post an update when I get some more time though.

06 Nov
1 year ago

anpel left a reply on Run Database Seeders In Unit Tests

@jeroenherczeg this looks very useful. Is it still the way to do it in Laravel 5.5 or is there a better way?

22 Jun
1 year ago

anpel started a new conversation How To Escape Double Curly Braces In A Blade Template?

I am trying to create a slideshow with thumbnails as shown at http://jquery.malsup.com/cycle2/demo/pager.php#adv-custom.

The markup I need to use is <img src='{{src}}' width=20 height=20>.

How can I escape the markup so that blade prints it with no errors?

I tried {!! '{{src}}' !!} but it did not work.

24 Apr
2 years ago

anpel left a reply on Sudden Npm Error

All I really use mix for is copying a few js scripts and running sass, so I had not changed the package.json file too much.

After a couple of failed attempts to fix the problem, I just gave up and did the following steps:

  1. Change my package.json with the latest version from github.
rm package.json
wget https://github.com/laravel/laravel/blob/master/package.json
  1. Delete the node_modules directory and reinstall everything
rm -rf node_modules
npm install

Everything works perfect ever since, and I was able to get back to work.

@zLegend-210 my package.json at the time of posting was the following:

 {
   "private": true,
   "scripts": {
     "dev": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
     "watch": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
     "watch-poll": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --watch --watch-poll --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
     "hot": "node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
     "production": "node node_modules/cross-env/dist/bin/cross-env.js 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",
     "jquery": "^3.1.1",
     "laravel-mix": "^0.8.1",
     "lodash": "^4.17.4",
     "vue": "^2.1.10"
   }

@peterprins I ended up using "cross-env": "^3.2.3", that is part of the latest package.json file that ships with Laravel.

anpel started a new conversation Sudden Npm Error

Hello all,

my site is running laravel 5.4 on homestead and I have been able to configure and run npm run dev and npm run watch.

The site is also deployed on a remote server and they are kept in sync with each other using git. Both worked fine.

Suddenly this morning, without updating anything or changing any mix related files, my local installation stopped working.

It was using:

npm version 4.3 node version 7.6 mix version 0.8.3.

I thought it might need some updates, so I updated everything and now I have:

npm 4.5 node 7.8 mix 0.11

The commands still do not run though, I get the following output:

` [email protected]:~/Code/mysite$ npm run dev

@ dev /home/vagrant/Code/mysite node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

internal/child_process.js:319 throw errnoException(err, 'spawn'); ^

Error: spawn EACCES at exports._errnoException (util.js:1034:11) at ChildProcess.spawn (internal/child_process.js:319:11) at Object.exports.spawn (child_process.js:378:9) at spawn (/home/vagrant/Code/mysite/node_modules/cross-spawn/index.js:17:18) at crossEnv (/home/vagrant/Code/mysite/node_modules/cross-env/dist/index.js:30:38) at Object. (/home/vagrant/Code/mysite/node_modules/cross-env/dist/bin/cross-env.js:10:16) at Module._compile (module.js:571:32) at Object.Module._extensions..js (module.js:580:10) at Module.load (module.js:488:32) at tryModuleLoad (module.js:447:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! @ dev: node node_modules/cross-env/dist/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the @ dev script 'node node_modules/cross-env/dist/bin/cross-env.js 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! node node_modules/cross-env/dist/bin/cross-env.js 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! A complete log of this run can be found in: npm ERR! /home/vagrant/.npm/_logs/2017-04-24T04_14_21_154Z-debug.log `

Also, the log file mentioned in the error does not seem to exist, it does not seem to be created unless I run sudo npm run dev.

Can anyone please point me to the right direction on how to fix this and go on with development?

11 Apr
2 years ago

anpel left a reply on How Can I Use TinyMCE With Laravel Mix?

@willvincent thank you for your time.

Sadly, after changing my files to:

mix.webpackConfig({
  module: {
    loaders: [
      {
        test: require.resolve('tinymce/tinymce'),
        loaders: [
          'imports?this=>window',
          'exports?window.tinymce'
        ]
      },
      {
        test: /tinymce\/(themes|plugins)\//,
        loaders: [
          'imports?this=>window'
        ]
      }    
    ]
  }
});

mix.js('resources/assets/js/app.js', 'public/js')
   .sass('resources/assets/sass/app.scss', 'public/css')
   .browserSync({proxy: "pelepharm.dev"});

And:

require('./bootstrap');

// Core - these two are required :-)
import tinymce from 'tinymce/tinymce'
import 'tinymce/themes/modern/theme'

// Plugins
import 'tinymce/plugins/paste/plugin'
import 'tinymce/plugins/link/plugin'
import 'tinymce/plugins/autoresize/plugin'

// Initialize
tinymce.init({
  selector: '#description',
  skin: false,
  plugins: ['paste', 'link', 'autoresize']
});

the console message disappears, but TinyMCE still fails to load (shows whole textarea blank, no outines).

Is there another way I could set up TinyMCE to work or will I have to switch editor? If it's the latter, do you have any in mind that would work out of the box in this case?

anpel started a new conversation How Can I Use TinyMCE With Laravel Mix?

I'm on 5.4 but I don't know much about webpack.

I am trying to use TinyMCE on a textarea but it never loads and in the console I keep getting the message: "TypeError: Theme is not a constructor".

I have installed it using npm install tinymce --save and it appears in the node_modules directory as expected.

My webpack.mix.js file:

mix.js('resources/assets/js/app.js', 'public/js')
      .sass('resources/assets/sass/app.scss', 'public/css')
      .browserSync({proxy: "mydomain.dev"});    

And my app.js file:

// I have not edited this file
require('./bootstrap');

// Use tinymce from node modules
require('tinymce');

tinymce.init({
    selector: '#description',
    height: 500,
    menubar: false,
    plugins:[],
    toolbar: 'undo redo | insert | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
    content_css: '//www.tinymce.com/css/codepen.min.css'                                                                                                                                                       
});

Can you please point me in the right direction?