wilk_randall

wilk_randall

Member Since 2 Years Ago

Experience Points 170,360
Experience Level 35

4,640 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 640
Lessons
Completed
Best Reply Awards 120
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.

17 Jul
20 hours ago

wilk_randall left a reply on How To Obfuscate Ids?

Obfuscating an ID isn't going to make your application any more secure. It'd be better to perform the correct authorization checks for your resources instead.

If you don't want to expose the ID, I would just keep the id column and then add a uuid column that gets generated on user creation, which you could then expose and use that value to query for your users.

16 Jul
1 day ago

wilk_randall left a reply on Blade Echoing Returning 1

@snapey You make a good point. I usually use view composers to accomplish things like this but it's probably just a personal preference.

wilk_randall left a reply on How To Display An Element With Javascript

It seems you're trying to toggle a bootstrap class, but css isn't what you're looking for. Use $('#referral_code').toggleClass('d-block'); instead.

wilk_randall left a reply on Blade Echoing Returning 1

Is there a reason you're using view()->share() in a controller? If you only need it for one endpoint, I'd just send the data through when returning the view, otherwise I would use a view composer to share the variable with specific views.

https://laravel.com/docs/5.8/views#view-composers

As far as your variable goes, try using dd($body_class) to see what the value is, as I'm guessing it's a boolean value.

wilk_randall left a reply on Success Notification Best Practice

I think it's really up to you and what works best for you. I personally like to return the message from the server since I usually will use language lines for my messages.

15 Jul
2 days ago

wilk_randall left a reply on Forge: Script For Adding Column To Production Database Table

It should work since you have composer install included in the script. Although it doesn't hurt to have dbal installed, I don't think you'll actually need it since I'm pretty sure you really only need it if you want to change column names or column definitions.

12 Jul
5 days ago

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

If you're using mailtrap, the port is typically 2525, but just check your settings and it will tell you which port to use, along with any other credentials you need to use.

wilk_randall left a reply on Not Getting The Same Result In Vue

@munazzil I'm sorry, but are you special or something? The php version has absolutely nothing to do with the error here and running those commands isn't going to fix the issue. Not mutating the prop value in the component is what will though.

11 Jul
6 days ago

wilk_randall left a reply on Sql Query Too Slow

Try not to use active record on search with that many records, rather use getPdo().

There is seriously no need to reach for a PDO instance directly in the majority of cases. If you structure you database correctly with the right indexes and also make your queries efficient then Eloquent will do just fine.

wilk_randall left a reply on Error While Storing Route ID

oh its a token i guess

No it's not. _token is almost always the csrf token generated by the framework, which you shouldn't be using for any id. Unless value is your id, which by the looks of it it's not, you're not including the id in form or in the url.

If you have the id as part of your endpoint, you can just pass that in to the controller method and access it from there:

public function store(Request $request, $id)
{
   ...
   $review->restaurant_id = $id;
}

This would require you to have a route with something like this:

// Of course change the route signature to your needs
Route::post('reviews/{id}/store', '[email protected]');

wilk_randall left a reply on Not Getting The Same Result In Vue

The error you're getting doesn't really have anything to do with your environment. Make sure in whatever component you have a prop called selected_parent in that you're not modifying that prop's value anywhere in it.

09 Jul
1 week ago

wilk_randall left a reply on Laravel Forge On VPS With WHM

@haykd I say "appears" because that OS is the only option they give you when creating a new server or using a custom VPS, so I'm guessing it's "official".

wilk_randall left a reply on Laravel Forge On VPS With WHM

It appears that forge only supports Ubuntu 18.04 at this time.

04 Jul
1 week ago

wilk_randall left a reply on NPM Run Prod In Forge

Hmm, maybe try running npm clean-install and then try running the command again.

03 Jul
2 weeks ago

wilk_randall left a reply on How Html Developer Can Work With Live Site?

@roborobok I agree. You can't really do much with just HTML and CSS alone, so knowing a server side language/framework and/or client side languages will make you more marketable and allows you to develop much more comprehensive sites.

wilk_randall left a reply on Increment Attribute Value By Vue

I would just use the index of the current iteration for the name. There's no need for regex or whatever else you're doing.

<input v-for="(input, index) in inputs" 
            :name="`tag[${index}]`"
            :key="index"
            v-model="input.value"
>

wilk_randall left a reply on NPM Run Prod In Forge

Try checking your log files for more information.

wilk_randall left a reply on 413 Request Entity Too Large ( When Uplaoding Image )

Are you sure you're editing the correct php configuration file? You can run php --ini to check.

wilk_randall left a reply on Call To Undefined Method Error

@munazzil that just isn't correct at all. Where do you even get this information from??

wilk_randall left a reply on How Html Developer Can Work With Live Site?

Either make the developer learn Vue or find someone who already knows it.

02 Jul
2 weeks ago

wilk_randall left a reply on HOW TO CONNECT TO MY SERVER FROM FILEZILLA

Forge disables password authentication by default, so you need to use a public/private ssh key pair to connect to it.

30 Jun
2 weeks ago

wilk_randall left a reply on Meaning Of $name => $value When Iterating Arrays

Typically you use $name => $value when iterating over an associative array, where $name would be the key and $value would be the value of the current element in the array. You can use this same syntax on indexed arrays as well, where $name would be the index of the current array element in this case.

https://www.w3schools.com/php/php_arrays.asp

12 Jun
1 month ago

wilk_randall left a reply on Class 'Illuminate\Notifications\NexmoChannelServiceProvider' Not Found

@munazzil For one, just like everyone else, we're not insulting you; we're simply calling you out for providing terrible answers that make no sense all the time. Also, don't flatter yourself. No one is making fake accounts or whatever to "insult" you or is following you.

11 Jun
1 month ago

wilk_randall left a reply on Email With Dynamic Content From Controller.

@gouseferoz sure.

Your mailable

public $user;

__construct($user)
{
   $this->user = $user;
}

The template

<p>Hello, {{ $user->name }}</p>

Your controller

Mail::to($user)->send(new YourMailableName($user));

wilk_randall left a reply on Email With Dynamic Content From Controller.

Pass the data through the mailable's constructor and set it as a public property on the mailable. Then you will have access to that variable in the template.

wilk_randall left a reply on Using Another Database With PDO Commands.

Did you import PDO into your class? It looks like that's the issue from the error message you're getting.

08 Jun
1 month ago

wilk_randall left a reply on Allow To Login With Passwords

Also be sure to run sudo systemctl restart sshd after modifying the configuration

wilk_randall left a reply on Allow To Login With Passwords

Shell into your server, and then edit /etc/ssh/sshd_config. Change PasswordAuthentication to yes

03 Jun
1 month ago

wilk_randall left a reply on Is It Safe To Use Double !! !! Only For Fetching Data From Server?

Or better yet, just don't use special characters in tests like these.

wilk_randall left a reply on Is It Safe To Use Double !! !! Only For Fetching Data From Server?

Depends on what you're retrieving, but generally I use {{ as I do not trust user input. You're better off writing Example &amp; Example in the assertion, or I think you could also do e($tag->title) as well.

01 Jun
1 month ago

wilk_randall left a reply on PHP Storm

Reading the documentation on something also helps you learn more about it.

30 May
1 month ago

wilk_randall left a reply on Use React Componentin In Vue

You could always just write your own implementation of it in Vue

28 May
1 month ago

wilk_randall left a reply on Decrypt Data In Blade

In your guest model, I would make an accessor that decrypts the value.

public function getNameAttribute($name)
{
      return decrypt($name);
}

If that doesn't work, maybe provide an error message instead of just saying "it doesn't work"

27 May
1 month ago

wilk_randall left a reply on When I Change The Quantity Of My Items, The Total Doesn't Update (PHP)

@aricia I wouldn't pay much attention to anything @munazzil tells you. I don't think I've ever seen him write a response that remotely makes sense or is helpful.

24 May
1 month ago

wilk_randall left a reply on Security In Controller

For my projects I prefer to either use route middleware or policies for access control to the system.

23 May
1 month ago

wilk_randall left a reply on Serve Multiple Laravel Apps On Localhost With Php Artisan Serve

If you're on windows, you can Laragon which works similar to valet and works really well. I use it for my own development.

wilk_randall left a reply on Serve Multiple Laravel Apps On Localhost With Php Artisan Serve

Have you tried specifying the port when running the command?

php artisan serve --port=8001

wilk_randall left a reply on Adding A Zero To A Calculation

If it's always two decimal places and you want/need commas in the number to separate the thousands, you can also use number_format.

{{ number_format($price, 2) }}
22 May
1 month ago

wilk_randall left a reply on Auth::user() Not Returning All Elements

You're using ['admin'].includes(user.username). Shouldn't it be ['admin'].includes(user.role)?

wilk_randall left a reply on Ajax Validation Server Side - Conslusions?

As a rule of thumb, you should never trust user input, so even with ajax requests you should be doing server-side validation. I personally also do client-side validation via JavaScript, but that in my opinion is optional, but at a minimum you should have server-side validation in place.

wilk_randall left a reply on Want To Redirect Others Route When Error Occur For Code Or Syntax Fault

I agree with the others. You should really focus on fixing your code instead.

19 May
1 month ago

wilk_randall left a reply on Where Correct Word

@jlrdw Yea that's what I meant which is why I said "not case sensitive". I agree that people should read documentation, but it's unrealistic to expect everybody to read the docs.

wilk_randall left a reply on Where Correct Word

Mysql selects are not case sensitive by default, so what you are getting is correct. You can use BINARY in laravel if you use a DB::raw. Here is an example I found on stack overflow.

Invite::where(DB::raw('BINARY `token`'), $token)->first();

wilk_randall left a reply on Slug

I suggest using https://github.com/spatie/laravel-sluggable. It's pretty easy to setup and use.

17 May
2 months ago

wilk_randall left a reply on Best Practice For Display Current User Information

For me, I like to avoid queries in a blade whenever possible but I think it's really a preference thing when it's for something for the authenticated user. If it were me, I would query in the controller and send the data down to the view.

wilk_randall left a reply on How To Get Count From Select Query ?

DB::table('table')->where('number', 'LIKE', '%aa%')->count();
16 May
2 months ago

wilk_randall left a reply on Prevent Site Going Down When Route Does Not Exist

@chilitomato If you use GIT you can setup automatic deployments when you push to a branch and after the code is pushed you can have a script automatically run. That way nobody even has to remember to run it. You're making things much harder than they need to be.

wilk_randall left a reply on Prevent Site Going Down When Route Does Not Exist

To me, this just seems completely unnecessary. Just make a deployment script that runs php artisan route:cache during deployments automatically for you and you won't have that problem.