amirhazz

Member Since 2 Years Ago

London

Senior Web Developer at TalkTalk

Experience Points 149,200
Experience Level 30

800 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 1450
Lessons
Completed
Best Reply Awards 1
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.

09 Jan
2 months ago

amirhazz left a reply on Class App\Providers\AppServiceProvider Not Found Within ProviderRepository.php

composer dump-autoload
php artisan clear-compiled

amirhazz left a reply on Is There One Artisan Command That Clears All Caches?

php artisan route:clear && php artisan view:clear && php artisan debugbar:clear && php artisan config:clear && php artisan cache:clear && php artisan clear-compiled

amirhazz left a reply on Auto Logout If No Activity In Given Time

them what is

'lifetime' => 600,

in session.php file?

08 Jan
2 months ago

amirhazz left a reply on 404 Not Found NGINX Error

Apparently, forge doesn't generate the nginx.conf for your IP.

Need to change

listen 80;
listen [::]:80;

To

listen 80 default_server;
listen [::]:80 default_server;

in your /etc/sites-available/yourdomain.com

01 Dec
3 months ago

amirhazz left a reply on How To Use Offset And Limit In Laravel Query?

@realrandyallen actually that's what I was looking for.

30 Nov
3 months ago

amirhazz left a reply on How To Use Offset And Limit In Laravel Query?

How to take everything and skip some?

21 Sep
5 months ago

amirhazz started a new conversation Forge With GCP

Hey guys,

ANy of you have experience working with Google Could and Laravel Forge? If yes how is it going to work and have you ever had bad experience with GCP?

03 Sep
6 months ago

amirhazz left a reply on Valet Park Not Working

Are you in the directory where you want to valet to work for example Sites directory, when you run valet park?

amirhazz left a reply on Why The .env And .htaccess Files Are Not Copied With "cp -r"?

you should use mv command instead of cp.

26 Aug
6 months ago

amirhazz left a reply on 502 Bad Gateway

I just restarted everything:

  • Server
  • php
  • mysql
  • nginx

I pushed something and i didn't get any 502 error anymore

08 Aug
7 months ago

amirhazz left a reply on Forge - Droplet Resizing W/ Digital Ocean

anyone knows what will happen to queues and commands after resizing?

25 Jul
7 months ago

amirhazz left a reply on Laravel - Like \ Dislike System

@robrogers3 that's more like it. it's a good approach. Thanks

23 Jul
7 months ago

amirhazz left a reply on Laravel - Like \ Dislike System

@robrogers3 but that's not dislike implementation in order to do that you need 1 integer field in your db for each record to increment or decrement it.

01 Jul
8 months ago

amirhazz left a reply on SMS Template In Blade

@Robstar well it really depends on what the sms includes. These days sms aren't just a text anymore you can attach them from photo to pdf but if it's short message as its called "sms" then yeah you're right.

28 Jun
8 months ago

amirhazz left a reply on SMS Template In Blade

sprintf is very lazy in my opinion. You can create, view, job, event listener or the easiest one with no blade view required is using a Laravel notification.

amirhazz left a reply on Logic Inside A Blade - Bad Practice Or Not?

@martinbean You didn't get what I said! I said sometimes doesn't matter. It's up to you to ask yourself this question: "does it matter?".

26 Jun
8 months ago

amirhazz left a reply on Logic Inside A Blade - Bad Practice Or Not?

@Yorki sometimes doesn't matter. The question you should ask yourself is "Does it matter"

amirhazz left a reply on How To Decode JWT Tokens ?

function parseJwt (token) {
            var base64Url = token.split('.')[1];
            var base64 = base64Url.replace('-', '+').replace('_', '/');
            return JSON.parse(window.atob(base64));
};
14 Jun
9 months ago
08 Jun
9 months ago

amirhazz left a reply on Database Config.php Or .env

Because of many reasons:

  • When you push to source control like GitHub people can see your credentials
  • Environment variables are set to allow access to command line tools and to enable other tools to interact with SDKs more easily.
  • other reasons ...
05 Jun
9 months ago

amirhazz left a reply on What Things Should I Read Up On When Learning To Deploy Laravel Apps?

@p0t4t0 It depends on what services do you want to use but it's cost for me up to £20 a month max with hosting, domain, services and so on and if I code everything myself. Also it depends on what do you want to sell.

04 Jun
9 months ago

amirhazz left a reply on What Things Should I Read Up On When Learning To Deploy Laravel Apps?

Actually working with unix commands and setting up your own stack requires time and skill even more if you want to use schedulers, queues, SSL, environment variables and so on. Laravel Forge is your best friend when it comes to deploying and managing your applications on digital ocean, Linude, AWS and others with very few costs. Trust me it worth more than what it cost.

amirhazz left a reply on Is It Possible To Highlight The Area Between 2 Divs?

You could use display: table for this kind of implementation :

html,
body {
  margin: 0;
  padding: 0;
}
.wrap {
  display: table;
  width: 100vw;
}
.one {
  display: table-cell;
  height: 50px;
  width: 20%;
  background: red;
}
.two {
  display: table-cell;
  height: 50%;
  width: 60%;
  background: cornflowerblue;
}
.three {
  display: table-cell;
  background: lime;
  height: 50px;
}
<div class="wrap">
  <div class="one"></div>
  <div class="two"></div>
  <div class="three"></div>
</div>
30 May
9 months ago

amirhazz left a reply on Date Now()

in Laravel do

use Carbon\Carbon;

now()->gte(Carbon::parse('2018-06-15')) 
    ? // greater than or equal
    : // else
    ;

29 May
9 months ago

amirhazz left a reply on Send Notif Via WhatsApp

You'll need to build custom notifications here

https://laravel.com/docs/5.4/notifications#custom-channels

because there is nothing related to whats app here

http://laravel-notification-channels.com/

amirhazz left a reply on Unsupported Operand Types When Pass The Variable With Dot (.) Symbol

You can't use . instead of -> symbol in PHP as operand type.

amirhazz left a reply on How To Achieve This Output If The Id Is The Same?

If is the db query why don't you get distinct result?

https://laravel.com/docs/5.6/queries#selects

24 May
9 months ago

amirhazz left a reply on Adding Regular Stripe Shopping Cart To Spark

Not really there us no caveats using stripe and single charge. For instance i wanted to use Stripe to create a gym website. My client said I am going to have a single time joining fee. In EventServiceProvider.php there are bunch of events when a user has subscribed so I created a listener called ChargeJoinFee and used it like so:

UserSubscribed::class => [
    UpdateActiveSubscription::class,
    UpdateTrialEndingDate::class,
    SendEmails::class,
    ChargeJoinFee::class,
],

and then in there I charged the user like so:

public function handle($event)
{
    $event->user->charge(2500);
}

amirhazz left a reply on Unable To Deploy A Test Application In Forge

No problem. It's weird that is empty. Yes update that file exactly the same as your .env file. also you need to change these variables like so:

APP_ENV=production
APP_DEBUG=false
APP_KEY=for_this_type_php_artisan_key_generate

for APP_KEY you will need to type php artisan key:generate in your app console and grab that key and paste it in there.

Usually forge will create that file and does it for you but I don't know why you don't have it.

amirhazz left a reply on Cloudflare Caching Issue

First of all are you using Opcache in forge? Also I suggest you to use Cloudflare's own SSL certificate instead of LetsEncrypt. @TaylorOtwell wrote a nice article about how to do that:

https://medium.com/@taylorotwell/free-wildcard-ssl-using-forge-cloudflare-ab0ebfbf129f

amirhazz left a reply on Laravel Join Tables Query

Please take a look at the docs for Join

https://laravel.com/docs/5.6/queries#joins

amirhazz left a reply on How To Make Ajax Request

You can create a route in web.php file. That route will hit a controller and a method within the controller, in controller you can user Eloquent or any collection helper to get result from multiple database table and then return the result as an array which Laravel will make that array into JSON response or you can return response() and then axios can then retrieve and in it's promise in then() you can use it's response data to do whatever you cant.

amirhazz left a reply on Unable To Deploy A Test Application In Forge

When you use forge, it will create a default .env file for your app with database username forge and a secure password which it will email you. Keep that email which is very important. You don't need to generate an .env file. In Environment tab, update your credentials.

amirhazz left a reply on $this->request->get() Doesn't Work Inside FormRequest

why don't you use request() helper? did you do dd($this->request) to see if it returns anything at all?

23 May
9 months ago

amirhazz left a reply on Manually Process Queued Jobs

What do you mean by "Manually Process"? Queues meant to be processed asap in the background.

22 May
9 months ago

amirhazz left a reply on How To Get Data To A View That Will Become A Pdf?

You need to use response with pdf header or use some third part packages:

return Response::make(file_get_contents($path), 200, [
    'Content-Type' => 'application/pdf',
    'Content-Disposition' => 'inline; filename="'.$filename.'"'
]);

amirhazz left a reply on How To Make A Payment Beside Using Stripe Or Braintree?

Well cashier makes it super easy accepting payments. I used GoCardless without cashier and I somehow looked at the strategy in cashier and built something similar. It's not that hard. Some payment gateways only have redirections which makes it even easier.

20 May
9 months ago

amirhazz left a reply on How To Decrypt Hash Password In Laravel

It's one way algorithm and can't be decrypted.

amirhazz left a reply on How To Get 1 If Checkbox Is Checked Otherwise Get 0 If Checkbox Is Unchecked

You need a hidden input

<input type="checkbox" value="1" checked name="custom"> 
<input type="hidden" value="0" name="custom" >

amirhazz left a reply on Laravel Project Not Running On Xampp

I suggest you to use docker or vagrant.