Nash

Nash

Member Since 3 Years Ago

Experience Points 93,160
Experience Level 19

1,840 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 112
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.

13 Sep
2 days ago

Nash left a reply on 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.

03 Sep
1 week ago

Nash left a reply on 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

26 Aug
2 weeks ago

Nash left a reply on 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.

19 Aug
3 weeks ago

Nash left a reply on Adding A Bash Script In Laravel Forge Scheduler

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

07 Aug
1 month ago

Nash left a reply on 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.

05 Aug
1 month ago

Nash left a reply on 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.

04 Aug
1 month ago

Nash left a reply on 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.

Nash left a reply on 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?

03 Aug
1 month ago

Nash left a reply on 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.

02 Aug
1 month ago

Nash left a reply on 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

30 Jul
1 month ago

Nash left a reply on @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
24 Jul
1 month ago

Nash left a reply on 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.

Nash left a reply on 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.

22 Jul
1 month ago

Nash left a reply on Wrong URL

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

Nash left a reply on Wrong URL

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

21 Jul
1 month ago

Nash left a reply on 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.

20 Jul
1 month ago

Nash left a reply on 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.

Nash left a reply on 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() 

19 Jul
1 month ago

Nash left a reply on 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

Nash left a reply on 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?

Nash left a reply on 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

17 Jul
1 month ago

Nash left a reply on 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

15 Jul
2 months ago

Nash left a reply on 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.

Nash left a reply on Cashier For Braintree Abandoned!?

What is the best option now?

Stripe?

12 Jul
2 months ago

Nash left a reply on Laravel Mail Working Locally But Not On Server

Try with MAIL_ENCRYPTION=tls as well

11 Jul
2 months ago

Nash left a reply on 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

Nash left a reply on 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

10 Jul
2 months ago

Nash left a reply on 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...

Nash left a reply on 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

01 Jul
2 months ago

Nash left a reply on 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.');
            }
        },

    ],
])

Nash left a reply on 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.

Nash left a reply on 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

Nash left a reply on Capture Exec Output

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

Nash left a reply on 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

28 Jun
2 months ago

Nash left a reply on 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.

Nash left a reply on 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?

25 Jun
2 months ago

Nash left a reply on 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

24 Jun
2 months ago

Nash left a reply on 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

22 Jun
2 months ago

Nash left a reply on 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.

20 Jun
2 months ago

Nash left a reply on 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

Nash left a reply on 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

19 Jun
2 months ago

Nash left a reply on 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.

Nash left a reply on 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');

Nash left a reply on 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');

Nash left a reply on Where != Foo Also Excludes Null

Try

Model::where('foo', '!=', 'bar')
    ->orWhereNull('foo')
    ->get();
17 Jun
2 months ago

Nash left a reply on PDOException::("could Not Find Driver")

You have DB_CONNECTION set to mysql in your previous post on a similar topic. Are you trying to use MySQL or SQLite?

Nash left a reply on PDOException::("could Not Find Driver")

Simply creating a new file will not create a new database in MySQL (SQLite works like this though).

Check out this basic guide on MySQL: https://www.digitalocean.com/community/tutorials/a-basic-mysql-tutorial

Nash left a reply on Unable To Do Php Artisan Migrate

Is MySQL actually running (check with systemctl status mysql.service) and have you created a database named meriki? If you are not using Homestead, did you create the migrations table by doing php artisan migrate:install?