Nash

Nash

Member Since 3 Years Ago

Experience Points
94,640
Total
Experience

360 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
201
Lessons
Completed
Best Reply Awards
114
Best Reply
Awards
  • start-engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-session Created with Sketch.

    School In Session

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

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

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

  • subscriber-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist Created with Sketch.

    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 Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

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

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

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

Level 19
94,640 XP
Oct
03
2 months ago
Activity icon

Replied to Middleware: How To Use 'OR' Statement In Router

You can't. But you can, for example, make the create_task middleware check if the user is an admin (because that is one of the accepted conditions for creating a task, right?).

Sep
18
2 months ago
Activity icon

Replied to Laravel: Drag And Drop Fields Funtionalities.

There are JavaScript libraries that you can use for drag and drop, e.g. Draggable JS or the one you just linked to.

Activity icon

Replied to NPM Commands Vs. Ubuntu Commands

Homestead is a virtual Ubuntu/Linux box that comes with most of the stuff you may potentially need to develop your Laravel application pre-installed (Composer, NPM, Nginx, Apache, MySQL, etc.). The same stuff can be manually installed in Windows as well but that kind of defeats the purpose of using Homestead. The idea is that you SSH into the virtual Ubuntu machine and execute any commands you need there (Linux, NPM, Composer, etc.). NPM is a package manager for JavaScript packages; you use it to install, remove and update JS packages using commands like npm install, npm remove, npm update etc.

Sep
13
2 months ago
Activity icon

Replied to Sublime PHP Linter

The linter only checks for syntax errors and the second example is not syntactically wrong. You may want to consider using an IDE like PHPStorm if you need something with a deeper understanding of the actual logic.

Sep
03
3 months ago
Activity icon

Replied to How Can I Avoid To Stop Writting Script In Ckeditor ?

Replacing the script tag is not enough to prevent XSS. You need to carefully sanitize the content and only allow certain tags and attributes. HTMLPurifier can help you with this.

https://github.com/mewebstudio/Purifier

Aug
26
3 months ago
Activity icon

Replied to How To Get EXIF Data From An Image On S3?

How are you storing the image to S3, is the EXIF data really passed along or are you creating a new image? Try using ->orientate() when storing/uploading the image instead of during download.

Aug
19
3 months ago
Activity icon

Replied to Adding A Bash Script In Laravel Forge Scheduler

Doesn't your Forge server already have logrotate for this purpose?

Aug
07
4 months ago
Activity icon

Replied to Getting File Via FTP Driver

When you say "select the directory to save the file" do you mean 1. to Laravel's storage or 2. on your own computer (when downloading a file through the browser)?

In case 1, something like this should do the trick:

$file = Storage::disk('ftp')->get($filename);
Storage::disk('some-other-disk')->put($new_filename, $file);

In case 2, you need to change the default download location or set it to "always ask" in your browser's settings.

Aug
05
4 months ago
Activity icon

Replied to Npm Run Prod, Commits, And Forge

It could be caused by a change in how package-lock.json is structured in newer versions of npm, you might be running different versions on your dev machine and prod server.

Aug
04
4 months ago
Activity icon

Replied to Problem With Installation Of Laravel 5.5 Project

Your error message suggests that the mbstring PHP extension is missing from your system.

You didn't specify which distro you are using but sudo apt-get install php-mbstring or sudo apt-get install php7.1-mbstring should work for Debian and Ubuntu. Otherwise, just do a search for "<your-distro-here> php install mbstring" and you should get plenty of answers.

Activity icon

Replied to Npm Run Prod, Commits, And Forge

It should work like that and not rewrite anything. How does the "new" package.json file differ from the original one? What does your deployment script and error message look like?

Aug
03
4 months ago
Activity icon

Replied to Babel Issue Running Npm Run Dev After Upgrade To Mix

The error message suggests that it is trying to find a babel module that isn't there, so it must be referenced somewhere?

Try deleting the node_modules folder and the package-lock.json file and run npm install again. Also check if you have any old dependencies or references to old packages in your code or package.json file.

Aug
02
4 months ago
Activity icon

Replied to Babel Issue Running Npm Run Dev After Upgrade To Mix

From the mix upgrade guide:

Babel 7 support

The naming convention for official Babel plugins has changed. They are now scoped under the @babel namespace.

Update your package.json and change all occurences of "babel-plugin-[name]":

- "babel-plugin-[name]": "6.x"

+ "@babel/plugin-[name]": "7.x"

If you've created a .babelrc file in your project, update all plugin name references:

- "plugins": ["babel-plugin-transform-object-rest-spread"]

+ "plugins": ["@babel/plugin-proposal-object-rest-spread"]

https://laravel-mix.com/docs/4.1/upgrade

Jul
30
4 months ago
Activity icon

Replied to @if(!empty) Statement

You have your statement backwards, it should be:

@if (!empty($quote->customer->phone))
    <!-- If NOT empty, show phone -->
    <b>Phone:</b> {{ $quote->customer->phone }}
@else
    <!-- Else (if empty) show nothing / do something else -->
    Sorry, phone is empty
@endif
Jul
24
4 months ago
Activity icon

Replied to Database Query For Footer, What Is The Best Way To Do It?

Yes, you can use the query builder but a view composer might be a better choice here.

Activity icon

Replied to Database Query For Footer, What Is The Best Way To Do It?

A view composer or sharing data with all views should do the trick. Consider caching the query if the content rarely changes.

Jul
22
4 months ago
Activity icon

Replied to Wrong URL

Change the APP_URL to the right domain and compare your vhost + windows hosts file settings against these posts on StackOverflow:

Activity icon

Replied to Wrong URL

Is your APP_URL set to localhost in the .env file? Change it to the right url.

Jul
21
4 months ago
Activity icon

Replied to Connection Could Not Be Established With Host Smtp.mailtrap.io [Connection Refused #111]

Try other ports, like 465, and set MAIL_ENCRYPTION=tls.

And like @snapey said, reset your credentials because you just showed them to everyone.

Jul
20
4 months ago
Activity icon

Replied to Help With Multi Domain Sessions

Set the SESSION_DOMAIN to ".your-domain.tld" (instead of "www.your-domain.tld") if you want it to work for subdomains. Clear browser cache and cookies before use.

Activity icon

Replied to Can't Paginate Search Result Records?

You need to append the query string parameters, for example:

$results->appends(request()->query())->links() 

// for older versions (removing 'page' is not required in newer versions)
$results->appends(request()->except('page'))->links() 

Jul
19
4 months ago
Activity icon

Replied to The Exit Status Code '1' Says Something Went Wrong

You probably need the Windows version (since you appear to be running WAMP as opposed to a Linux environment):

Also, some old issue mentions the need for double quotes inside the single quotes in Windows, e.g. '"C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe"'

https://github.com/barryvdh/laravel-snappy/issues/31

Activity icon

Replied to The Exit Status Code '1' Says Something Went Wrong

And is it in E:\Nikki\Wamp\www\laravel-site\vendor/h4cc/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 like your config suggests?

Activity icon

Replied to The Exit Status Code '1' Says Something Went Wrong

Have you installed wkhtmltopdf and do you have the correct path in your config file?

See "Wkhtmltopdf installation": https://github.com/barryvdh/laravel-snappy#wkhtmltopdf-installation

Jul
17
4 months ago
Activity icon

Replied to PHP Laravel Framework 5.5.40 / 5.6.x < 5.6.30 - Token Unserialize Remote Command Execution

This issue has already been addressed. If you are using an up-to-date version of Laravel and you don't use cookie serialization, you should be in the clear. The vulnerability also needs the app key to be exploited.

https://laravel.com/docs/5.5/upgrade#upgrade-5.5.42

Jul
15
4 months ago
Activity icon

Replied to Cashier For Braintree Abandoned!?

Well Braintree still has a PHP SDK but you would have to integrate it yourself if Cashier no longer supports it. If Cashier is still working you may be fine for now but there's no telling whether it will break in a future update. You could fork the Laravel Braintree package but it's probably no small task to keep it up to speed with Laravel and any potential Braintree API changes. You could also consider switching to Stripe and integrating PayPal manually.

Edit: based on the commit-history it would appear that it was abandoned just 4 days ago so that might be why there hasn't been a notice yet? You could wait a bit and see if there's more on the topic soon.

Activity icon

Replied to Cashier For Braintree Abandoned!?

What is the best option now?

Stripe?

Jul
12
5 months ago
Activity icon

Replied to Laravel Mail Working Locally But Not On Server

Try with MAIL_ENCRYPTION=tls as well

Jul
11
5 months ago
Activity icon

Replied to Deep Replication (Model + Relations)

@holm There is also a package named Cloner that could help with this.

Laravel news article: https://laravel-news.com/eloquent-cloner-package

Activity icon

Replied to Undefined Variable: Products For PDF

The line in your controller should have compact('products') instead of compact($products).

@munazzil That answer does not make any sense

Jul
10
5 months ago
Activity icon

Replied to How To Show Existed Category Name In My Post Edit Form

@bikal Probably just a basic edit function that fetches the post and some categories and passes them to the view, for example:

public function edit(Post $post)
{
    $categories = \App\Category::all();
    return view('posts.edit', compact('categories', 'post'));
}

But I obviously can't know what OP's controller really looks like...

Activity icon

Replied to Laravel 5.8 Memory Leak

I haven't looked into this but if you really think you've found an actual memory leak, you should probably open up an issue at the official github repo so that the devs can comment on it:

https://github.com/laravel/framework/issues

Jul
01
5 months ago
Activity icon

Replied to Edit: Regex For Email

Something like this, for example. Modify to your own needs:

Validator::make($request->all(), [
    'email' => [
        
        // the standard "email" rule
        'email',
    
        // custom validation rule (using closures)
        function ($attribute, $value, $fail) {
            // split the string at every "."
            $exploded = explode('.', $value);
            // check if the last item matches "fr" or "com"
            if (! in_array(end($exploded), ['fr', 'com'])) {
                $fail($attribute.' is invalid.');
            }
        },

    ],
])
Activity icon

Replied to Edit: Regex For Email

Then ask for that instead of the "equivalent of FILTER_VALIDATE_EMAIL for Laravel".

You could probably do this using the regex rule or a custom validation rule in combination with the standard email rule.

Activity icon

Replied to Edit: Regex For Email

That would be the email rule, like you already have in your array.

https://laravel.com/docs/5.8/validation#rule-email

Activity icon

Replied to Capture Exec Output

Return it where? Are you actually doing anything with the $output variable? What does dd($output) return?

Activity icon

Replied to Capture Exec Output

The second parameter in exec is an array containing every line of the output from the command.

exec('your command here', $output_array);

https://www.php.net/manual/en/function.exec.php

Jun
28
5 months ago
Activity icon

Replied to PHP Artisan Not Stopping

Are you using the Linux (WSL) terminal to launch the Windows CMD and execute Windows programs/commands? This seems like a messy setup. I would rather install/run them directly under WSL, simply use Windows, or install Laravel Homestead (a virtual Ubuntu machine with everything you need for Laravel development) and then SSH into that.

You could also try MobaXterm. It gives you the basic UNIX tools and commands but should still be able to execute native Windows programs just like you would in CMD.

Activity icon

Replied to Testing Flash Messages And Redirects

Do you really need all 3 assertions? Is the session key the main thing you are trying to test or would it be enough to check the HTTP status code (200 OK as opposed to some error code) + assertSee? Is there a situation where the session key is NOT set but the rest of the action would be successful and return 200?

Jun
25
5 months ago
Activity icon

Replied to Star Rating

There are numerous tutorials, packages and threads on this very topic, please do a search before asking.

Laracasts video: How Do I Create a Star-Rating System: Part 1

Jun
24
5 months ago
Activity icon

Replied to Post Requests Working Without CSRF Token

It's probably fetching it from the XSRF-TOKEN cookie?

https://laravel.com/docs/5.8/csrf#csrf-x-xsrf-token

Jun
22
5 months ago
Activity icon

Replied to Where To Find All Built In Classes In PHP

As you can see from the breadcrumbs (at the top of the page under the main menu), the ReflectionClass page is under Function Reference.

Jun
20
5 months ago
Activity icon

Replied to Versioning

Ah, I see now. One possible way would be to have separate branches for each release or version. One branch for v1, another for v2 and so on. You could still run them side by side as different applications if you want to.

Here's a classic article on Git branching that I like to refer to from time to time: https://nvie.com/posts/a-successful-git-branching-model/

Example Nginx config (to give you an idea, I did not make or test this particular config myself): https://gist.github.com/mreschke/27bfafb84add38d3bab8

Activity icon

Replied to Versioning

You should definitely look into a version control system like Git. There's even a Laracasts series on the topic:

https://laracasts.com/series/git-me-some-version-control

Jun
19
5 months ago
Activity icon

Replied to Set Restrictions In Migration

Well you can give the VARCHAR field a length (e.g. $table->string('name', 15)) but for the type of control that you are describing, you will need some sort of validation, for example using the size andregex rules:

https://laravel.com/docs/5.8/validation#available-validation-rules

The attributes in the form elements (HTML) can be easily modified by the user so you should always validate user input in the back end as well.

Activity icon

Replied to Intervention Image Not Resizing Image Greater Than 15mb

Is it the correct php.ini file? Try setting the limit in your code before the Intervention function:

ini_set('memory_limit', '1000M');
Activity icon

Replied to Where != Foo Also Excludes Null

This appears to be the case with SQL server at least, but you should be able to specifically tell it to include those rows as well e.g. by using ->orWhereNull('foo');

Activity icon

Replied to Where != Foo Also Excludes Null

Try

Model::where('foo', '!=', 'bar')
    ->orWhereNull('foo')
    ->get();