JeffreyWay

Founder at Laracasts

Experience

417,990

343 Best Reply Awards

  • Member Since 3 Years Ago
  • 130 Lessons Completed
  • 51 Favorites

8th May, 2017

JeffreyWay left a reply on Blade Braces In A Thread Title Breaks The Page • 1 week ago

Fixed. :) Thanks.

26th April, 2017

JeffreyWay left a reply on Custom "type" To The Class • 3 weeks ago

@theUnforgiven Yep. Or wrap it in a little server-side flash() function that does it for you.

function flash($message, $type = 'success') {
    session()->flash('flash', $message);
    session()->flash('flashType', $type);
}

//

flash('Welcome Aboard', 'success');

return redirect('/');

JeffreyWay left a reply on Custom "type" To The Class • 3 weeks ago

@theUnforgiven I'd probably do something like along the lines of this:

<template>
    <div :class="classes" role="alert" v-show="show">
        <strong>Success!</strong> {{ body }}
    </div>
</template>

<script>
    export default {
        props: ['message', 'type'],

        data() {
            return {
                body: '',
                style: '',
                show: false
            }
        },

        computed: {
            classes() {
                return [
                    'alert',
                    `alert-${this.style}`,
                    'alert-flash'
                ];
            }
        },

        created() {
            if (this.message) {
                this.flash(this.message, this.type);
            }

            window.events.$on(
                'flash', (message, type) => this.flash(message, type)
            );
        },

        methods: {
            flash(message, type) {
                this.body = message;
                this.show = true;
                this.style = (type || 'success');

                this.hide();
            },

            hide() {
                setTimeout(() => {
                    this.show = false;
                }, 3000);
            }
        }
    };
</script>

<style>
    .alert-flash {
        position: fixed;
        right: 25px;
        bottom: 25px;
    }
</style>

Usage:

flash('A message here', 'warning');

30th March, 2017

JeffreyWay left a reply on How Do Disable Live Reload When Running Npm Run Watch? • 1 month ago

It's not on by default, so not sure what you're asking.

23rd March, 2017

JeffreyWay left a reply on Can I Keep Using Elixir/Gulp After Migrating To Laravel 5.4? • 1 month ago

Yes, you may freely use any tool that you want.

22nd March, 2017

JeffreyWay left a reply on Laravel Forge Is Down. 22 March 2017 • 2 months ago

It's all related to that Ubuntu security update. They broke everything again today, when they reverted their mistake from yesterday. So weird...

13th March, 2017

JeffreyWay left a reply on Laravel Mix And PhpUnit • 2 months ago

No. It doesn't make much sense for a tool like Webpack.

6th March, 2017

JeffreyWay left a reply on Laravel 5.4 Dev Npm Run Dev Error • 2 months ago

@AccAdmin - It's because you have two different versions installed. Over the weekend, the cross-env team changed then path to to their bin directory, which we were referencing. You can fix this by doing npm install cross-env, and then updating your package.json npm script to be:

cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js

JeffreyWay left a reply on Why Laravel Dropped Elixir? Why Forcing Vue.js? What Is It That You Are Trying To Fix? • 2 months ago

@antraacks

It's just weird to me no other framework does this.

Imagine Django promoting Angular or Ruby On Rails Promoting React.

Rails is famous for promoting JS frameworks. Bad example.

and yes I can go and delete everything and keep my original package but if something is not broke what exactly are you guys fixing?

Dude, we're trying to make it easier to build applications. The core team likes Vue a lot and think it pairs well with Laravel. So we include a couple lines in a package.json file to get you started. Delete them, if you love Angular. Done.

JeffreyWay left a reply on Why Laravel Dropped Elixir? Why Forcing Vue.js? What Is It That You Are Trying To Fix? • 2 months ago

For all we know, there can be nothing except that they like VueJS or feel it guides/helps majority of users to build complete applications..

Or perhaps there is more behind the scenes, maybe Taylor has a stake in VueJS, or maybe Laravel is sponsored by VueJS,..

Guys, take your tinfoil hats off.

JeffreyWay left a reply on Why Laravel Dropped Elixir? Why Forcing Vue.js? What Is It That You Are Trying To Fix? • 2 months ago

@ANTRACKS Good grief.

But most major companies don't use Vue.js we use React or Angular.

Awesome. Then use React or Angular.

I can't remember on what version you guys started putting Vue in the package but ever since you guys started promoting it the support for other front end frameworks have gone to sht.

How so? Give examples? How is Laravel making it hard for you to include React in your projects??

Elixir worked perfectly there was no reason to drop it. Sass would compile super fast and even the largest react app now is 2x slower at compile.

Webpack is doing significantly more things than Elixir. But if Elixir was working great, use it. Nobody is making you do anything.

I want the old laravel back the one that I put neck on the line for.. the one that was a backend framework for php not a backend framework with a favorite front end framework.

Pro Tip: Delete the package.json file in a fresh Laravel app, and you have your old Laravel back.

But people come to you guys for the backend not to force down our throats VUE.JS!!!

Decaffeinated brands exist on the market.

I'll be honest this will be the last time I use laravel for any new project.

k.

2nd March, 2017

JeffreyWay left a reply on Laravel 5.4 Npm Run Watch Not Working • 2 months ago

Update node and npm. nodejs..org

JeffreyWay left a reply on How To Configure IncludePaths For SASS On Mix? • 2 months ago

I think you can do:

mix.sass('resources/assets/sass/app.scss', 'public/css', {
    includePaths: ["absolute/path/a", "absolute/path/b"]
});

JeffreyWay left a reply on Laravel Mix Versioning Issue • 2 months ago

@rachid_rafia I'm thinking that you have an old version of Laravel Mix installed. I just tried out your example code, and everything versioned properly.

https://www.dropbox.com/s/ca2md64krn5okc9/Screenshot%202017-03-02%2009.23.36.png?dl=0

For your other comment, if you're using a bunch of legacy plugins and scripts that weren't build with Webpack in mind, then mix.scripts() or mix.combine() (same thing) are what you want.

27th February, 2017

JeffreyWay left a reply on How To Write A Testimonial About This Site • 2 months ago

@CHIBYKE - You can shoot me an email and we'll add it to the testimonials page. :)

https://laracasts.com/contact

23rd February, 2017

JeffreyWay left a reply on Mix - Combine All Js In Folder • 2 months ago

@stwilson - You're using an old version of Laravel Mix. Do npm update laravel-mix.

JeffreyWay left a reply on Laravel 5.4 Errors On Npm Run Dev Error: Cannot Find Module '\..\$npm_package_config_webpack' • 2 months ago

@ANIMALINSTINCT For your first issue, it turns out that referencing Node config variables requires a completely different syntax in Windows, versus Mac or Linux. This has been fixed.

Update your package.json to look like this:

  "scripts": {
    "dev": "node node_modules/cross-env/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/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/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/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/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"
  }

Also, run npm update laravel-mix.

21st February, 2017

JeffreyWay left a reply on Laravel Mix And React Js • 3 months ago

Update Laravel Mix.

20th February, 2017

JeffreyWay left a reply on Laravel Mix And React Js • 3 months ago

@VernonGrant Yeah the GitHub repo will have the latest docs, but I have a todo item to update the Laravel.com docs with some of the new stuff in the last few weeks.

JeffreyWay left a reply on Laravel Mix And React Js • 3 months ago

mix.react('src', 'output');

JeffreyWay left a reply on Mix - Combine All Js In Folder • 3 months ago

mix.combine(['public/js/*'], 'public/combined.js');

Though you should be careful. Often, JavaScript files need to be loaded in the proper order.

JeffreyWay left a reply on Webpack Compile Order • 3 months ago

This is a Webpack-specific issue. There's an issue to get it fixed.

https://github.com/webpack/webpack/issues/215

JeffreyWay left a reply on Can I Version Specific File In Laravel Mix? • 3 months ago

Yes -

mix.version(['path/to/files.js']);

18th February, 2017

JeffreyWay left a reply on Laravel 5.4 MIX + Stylus • 3 months ago

@Dima I guess they haven't updated it yet.

https://www.dropbox.com/s/ofcoszi089n6fj8/Screenshot%202017-02-18%2013.24.59.png?dl=0

You can manually add it back in by doing:

col()
  column(arguments)

JeffreyWay left a reply on Laravel 5.4 MIX + Stylus • 3 months ago

@Dima - I think Jeet removed aliases like that with version 7, right?

JeffreyWay left a reply on Laravel 5.4 MIX + Stylus • 3 months ago

Rupture will automatically load in its mixins, so you don't need to explicitly import that. This setup is fully working for me.

https://www.dropbox.com/s/3e8i1filj6j1vu2/Screenshot%202017-02-18%2013.02.03.png?dl=0

webpack.mix.js

var mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.stylus('resources/assets/stylus/app.styl', 'public/css', {
    use: [
        require('rupture')(),
        require('nib')(),
        require('jeet')()
    ],
    import: [
        '~nib/index.styl',
        '~jeet/jeet.styl'
    ]
});
``


#### resources/assets/stylus/app.styl

```js
#back-to-top
  fixed bottom right // nib

section
    center(960px) // jeet

.thing
    tablet() // rupture
        background: blue

public/css/app.css

#back-to-top {
  position: fixed;
  bottom: 0;
  right: 0;
}
section {
  width: auto;
  max-width: 960px;
  float: none;
  display: block;
  margin-right: auto;
  margin-left: auto;
  padding-left: 0;
  padding-right: 0;
}
section::after {
  content: '';
  display: table;
  clear: both;
}

JeffreyWay left a reply on Laravel 5.4 MIX + Stylus • 3 months ago

Sure.

var mix = require('laravel-mix');

/*
 |--------------------------------------------------------------------------
 | Mix Asset Management
 |--------------------------------------------------------------------------
 |
 | Mix provides a clean, fluent API for defining some Webpack build steps
 | for your Laravel application. By default, we are compiling the Sass
 | file for the application as well as bundling up all the JS files.
 |
 */

mix.stylus('resources/assets/stylus/app.styl', 'public/css', {
    use: [
        require('rupture')() // npm install rupture
    ]
});

JeffreyWay left a reply on Laravel 5.4 MIX + Stylus • 3 months ago

@dima - Mix is significantly more powerful than Laravel Elixir. Stylus works with it out of the box.

laravel new project && cd project
npm install

Then update webpack.mix.js to be:

mix.stylus('resources/assets/stylus/app.styl', 'public/css');

And do npm run dev.

8th February, 2017

JeffreyWay left a reply on Just Combine Js-files • 3 months ago

Combining files isn't connected to your main Webpack bundle, so it should have no effect.

Is that the only thing in your webpack.mix.js file? Where is hammerjs coming from?

1st February, 2017

27th January, 2017

JeffreyWay left a reply on [5.4] Npm Run Watch Not Working • 3 months ago

@saaz I'd of course need more information to help debug. OS, Node/NPM version, etc. Using a VM or not?

Try adding the --watch-poll flag to your NPM script. Or just try:

node_modules/.bin/webpack --watch --watch-poll --config=node_modules/laravel-mix/setup/webpack.config.js

26th January, 2017

JeffreyWay left a reply on Can't Get Laravel Mix To Work - Frustration LIMIT Reached • 3 months ago

If you were just concatenating get the files with Elixir, then do the same thing with Mix. You can use mix.combine().

JeffreyWay left a reply on Can't Get Laravel Mix To Work - Frustration LIMIT Reached • 3 months ago

You shouldn't need to, because it's included in the sass-loader dependency that Mix has.

My guess is that something went wonky when you installed all of your Node dependencies. I'd do a rm -rf node_modules and then npm install from scratch.

JeffreyWay left a reply on Whats New In Laravel 5.4 Not In Searchbar • 3 months ago

Just a caching issue. It updates every couple of days.

I just manually cleared it, so you should see it now.

JeffreyWay left a reply on Can't Get Laravel Mix To Work - Frustration LIMIT • 3 months ago

"I got an error when running npm run dev that UIKIT is missing and not in the node_modules folder! What? Why is it all of sudden looking there? "

It's looking there because it can't find it locally, so it's now checking for an installed dependency. We'll need to see your JS files to know more.

"I don't have a vendor directory in node-sass!"

Are you sure you have node-sass installed? Try a fresh re-install.

Also, create threads like this on the Mix GitHub repo, so that we can actually help you.

http://github.com/jeffreyway/laravel-mix

JeffreyWay left a reply on [5.4 Laravel Mix] Unable To Change Js Output Path • 3 months ago

This is all fixed in the latest release. Update Mix.

25th January, 2017

JeffreyWay left a reply on Laravel 5.4 Dev Npm Run Dev Error • 3 months ago

@lindstrom - Hmm, and moment and codemirror are in your package.json file, and have been installed?

JeffreyWay left a reply on Laravel 5.4 Dev Npm Run Dev Error • 3 months ago

@lorvent Hard to help if you don't paste in your webpack.mix.js file.

10th January, 2017

JeffreyWay left a reply on It's For When The Release Of Laravel 5.4 ? • 4 months ago

I don't think there is a date yet. My best guess is February.

21st December, 2016

JeffreyWay left a reply on No Way To Report Spam If Spam Post Isn't The First Post • 5 months ago

Any signed in user may now report replies as spam. Just hover over the reply and click the frown in the top right corner.

Thanks!

16th December, 2016

JeffreyWay left a reply on Todd... • 5 months ago

It's a joke.

14th December, 2016

JeffreyWay left a reply on Vat On The Invoice • 5 months ago

No, you're posting on the forum.

But to answer your question, Laracasts is based in the US, so we don't add any VAT.

13th December, 2016

JeffreyWay left a reply on Is It Just Me? • 5 months ago

The playback speed button is specifically for this purpose. What is way too fast for some, is painfully slow for others. It's a tough to find the right pace.

JeffreyWay left a reply on Front-end Series • 5 months ago

You might start with this series. :)

https://laracasts.com/series/modern-css-workflow

11th December, 2016

JeffreyWay left a reply on Signature At The Bottom Of Every Post? • 5 months ago

Hmm, I'm not sure I see much value in adding signatures. I think most forums are so ugly and bloated. For now, I'd prefer to keep things as simple as I can.

2nd December, 2016

JeffreyWay left a reply on Looking For A Course • 5 months ago

Quick tip: http://laravelfromscratch.com will always point to the newest beginner Laravel series.

Currently, that's the 5.2 series, but I have to refresh it for 5.4 in January.

1st December, 2016

JeffreyWay left a reply on Starting With Elixir • 5 months ago

You should never call the elixir function more than once.

28th November, 2016

JeffreyWay left a reply on Copyright • 5 months ago

Jokes jokes jokes.

26th November, 2016

JeffreyWay left a reply on Rocket League Side Project. • 5 months ago

Ahem.... what exactly is this side project?

21st November, 2016

JeffreyWay left a reply on What Happened To Dashboard? • 6 months ago

The graph is still there. Checking your settings area.

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.