Our Black Friday sale is now live! All individual subscriptions are 50% OFF. This week only!

umairparacha

umairparacha

Member Since 4 Months Ago

faisalabad

Experience Points
15,460
Total
Experience

4,540 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
145
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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 4
15,460 XP
Nov
07
2 weeks ago
Activity icon

Replied to Why The Application Does Not Show The Login And Register Route If The Recently Registered User Does Not Verify His Email Address

So is there is any way to keep the user logged out until the user verifies its email address?

Activity icon

Started a new Conversation Why The Application Does Not Show The Login And Register Route If The Recently Registered User Does Not Verify His Email Address

Why the application does not show the login and register route if the recently registered user does not verify his email address.

Oct
26
4 weeks ago
Activity icon

Replied to How We Can Access The Guest Routes When The User Is Registered Recently And Not Verified The Email Address

Hi SNAPEY, It is another question please help me in it because I am stuck in it.

How to confirm something else in password confirmation middleware instead of a password.

I want to confirm pin instead of password help me. here is the code

<?php

namespace Illuminate\Foundation\Auth;

use Illuminate\Http\Request;
use Illuminate\Http\Response;

trait ConfirmsPasswords
{
    use RedirectsUsers;

    /**
     * Display the password confirmation view.
     *
     * @return \Illuminate\View\View
     */
    public function showConfirmForm()
    {
        return view('auth.passwords.confirm');
    }

    /**
     * Confirm the given user's password.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\JsonResponse
     */
    public function confirm(Request $request)
    {
        $request->validate($this->rules(), $this->validationErrorMessages());

		$this->resetPasswordConfirmationTimeout($request);
        return $request->wantsJson()
                    ? new Response('', 204)
                    : redirect()->intended($this->redirectPath());
    }

    /**
     * Reset the password confirmation timeout.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return void
     */
    protected function resetPasswordConfirmationTimeout(Request $request)
    {
        $request->session()->put('auth.password_confirmed_at', time());
    }

    /**
     * Get the password confirmation validation rules.
     *
     * @return array
     */
    protected function rules()
    {
        return [
            'password' => 'required|password',
        ];
    }

    /**
     * Get the password confirmation validation error messages.
     *
     * @return array
     */
    protected function validationErrorMessages()
    {
        return [];
    }
}
Activity icon

Started a new Conversation How To Confirm Someting Else In Password Confirmation Middlerware Instead Of Password

I want to confirm pin instead of password. How i can do this please?

Sep
01
2 months ago
Activity icon

Started a new Conversation How We Can Access The Guest Routes When The User Is Registered Recently And Not Verified The Email Address

I was testing, I registered a new user but not verified the email address and I am trying to go to the login route and other guest routes but it is redirecting me to the email/verify. Someone tell me how I can do this.

Aug
20
3 months ago
Activity icon

Started a new Conversation How To Get The Session Data In Javascript

here is my script

<script>
        @if(session()->has('success'))
        Swal.fire({
            icon: 'success',
            title: 'Success',
            text: 'Updated successfully!',
        })
        @endif
</script>

but this is not working.

Aug
05
3 months ago
Activity icon

Started a new Conversation How To Create And Update Data On Different Tables Using Only One Post Request

I want to update and also create data on different tables using only the post request from one form.

Here is my view

<form method="post" action="{{ route('purchase.adPack') }}">
                            <div class="row">
                                <div class="col-sm-12 col-md-6 col-xl-4 col-lg-4">
                                    <div class="form-group"><label for="sel1">Pack Type:</label>
                                        <input type="text" id="pt" name="pt" class="form-control" value="Gold Pack" disabled>
                                    </div>
                                </div>
                                <div class="col-sm-12 col-md-6 col-xl-4 col-lg-4">
                                    <div class="form-group"><label for="sel2">Purchase:</label>
                                        <select class="custom-select" name="no">
                                            <option selected disabled>-- Select Option --</option>
                                            <option value="1">No of AdPack 1</option>
                                            <option value="2">No of AdPack 2</option>
                                            <option value="3">No of AdPack 3</option>
                                            <option value="4">No of AdPack 4</option>
                                            <option value="5">No of AdPack 5</option>
                                            <option value="6">No of AdPack 6</option>
                                            <option value="7">No of AdPack 7</option>
                                            <option value="8">No of AdPack 8</option>
                                            <option value="9">No of AdPack 9</option>
                                            <option value="10">No of AdPack 10</option>
                                            <option value="11">No of AdPack 11</option>
                                            <option value="12">No of AdPack 12</option>
                                            <option value="13">No of AdPack 13</option>
                                            <option value="14">No of AdPack 14</option>
                                            <option value="15">No of AdPack 15</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                            <div class="row">
                                <div class="col-lg-4 col-xl-4 col-md-6 col-sm-12">
                                    <div class="form-group"><label for="usr">Enter Pin:</label>
                                        <input type="text" id="usr" class="form-control"></div>
                                </div>
                                <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4 op-6">
                                    <button type="button" data-toggle="modal" data-target="#myModal"
                                            class="btn btn-default">Purchase
                                        AdPower
                                    </button>
                                </div>
                            </div>
                        </form>

here is my controller

public function __construct($request)
		{
			$adPackType = $request['pt'];
			$numberOfAdPack = $request['no'];
			$validatedData = $request->validate([
				'pt' => 'required|string|exists:ad_packs,name',
				'no' => 'required|numeric',
			]);
			if ($validatedData['pt'] === 'gold') {
				$priceOfAdPacks = $validatedData['no'] * 50;
				if (current_user()->mainPoints > $priceOfAdPacks ){
					for ($x = 0; $x <= $validatedData['no']; $x++){
						$existingMainBalance = current_user()->mainPoints->main_points;
						$newBalance = $existingMainBalance - 50;
						MainBalance::update([
							'main_points' => $newBalance
						]);
						$existingGoldPackBalance =  current_user()->adPowerBalance->gold_pack;
						$toAddBalance = $existingGoldPackBalance + 50;
						AdPowerBalance::create([
							'gold_pack' => $toAddBalance,
						]);
					}
				}
			}

		}

how I can do this

Aug
02
3 months ago
Activity icon

Replied to How To Validate Sql Injection On User Input

@snapey I want to know how to validate it on the user input level. I don't want to store the script in the database.

Jul
27
3 months ago
Activity icon

Replied to How To Validate Sql Injection On User Input

I add

<script>alert('hacked')</script>

in the input field and it was persisted to the database how I can fix this.

Jul
26
3 months ago
Activity icon

Started a new Conversation How To Validate Sql Injection On User Input

I was playing with laravel registration form and I add alert('hacked') to name field and it was not validated by laravel. So how to validate this.

Jul
10
4 months ago
Activity icon

Started a new Conversation How To Check The Request Is Null

Here is y controller

if (empty($request->except('_token'))) {
	return back()->withErrors('Nothing to update');
}

$user->update($data);
return redirect('/profile/edit')->withToastSuccess('Updated Successfully!');
Jul
08
4 months ago
Activity icon

Started a new Conversation How To Show Sweet Alert On Click Of Button

This is my javascript


document.getElementById('c-t-b').addEventListener('click', function () {
        var $temp = $("<input>");
        $("#referrallink").append($temp);
        $temp.val($("#referral_link").text()).select();
        document.execCommand("copy");
        $temp.remove();
        swal("Text Copied", "Done", "success");
    })
Activity icon

Started a new Conversation Why I Am Getting %7D At The End Of Url By Creating A Link With Named Routes

why I am getting %7D at the end of the URL by creating a link with named routes.

Jul
06
4 months ago
Activity icon

Started a new Conversation How To Submit Multiple Files But At Least One Is Required Other Are Optional

I want to submit multiple files and at least one is required the other ones are optional. Tell me about the validation and after when the user wants to upload the other two how to update them.

Jul
04
4 months ago
Activity icon

Started a new Conversation How To Select Next Value Just After A Particular Value In MySQL?

I was creating an application which contains a membership system. I want to show the user the upper-level memberships from the membership which the user is currently is on.

Jul
03
4 months ago
Activity icon

Replied to How To Get The Last Login Of A User

I was trying the same that @michaloravec is saying but I was not making the last_logged_at nullable on the table. Now it worked Thanks.

Activity icon

Started a new Conversation How To Get The Last Login Of A User

I want to show the last login of the user how I can get this.

Activity icon

Started a new Conversation How To Restrict Already Logged In User From Showing Home Page

In brand new laravel application, a user can visit the home page when he is logged in is there is any way to restrict this.

Jun
30
4 months ago
Activity icon

Commented on Send SMS Notifications In 5 Minutes

I am getting this error

Non White-listed Destination - rejected

help me with this issus