shahzadsarwar

shahzadsarwar

Member Since 8 Months Ago

Experience Points 290
Experience Level 1

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

14 Apr
2 months ago

shahzadsarwar started a new conversation Laravel Array To String Conversion On Multiple Records

I'm trying to save multiple records at once..

When I try to store multiple records it gives an error of array to string conversion.

This is the response I get from axios.

array:2 [ 0 => array:3 [ "property_type_id" => 2 "fee_value" => "123" "product_service_id" => 1 ] 1 => array:3 [ "property_type_id" => 1 "fee_value" => "3333" "product_service_id" => 1 ] ]

my controller method

$feeByPropertyType = $request->feeByPropertyType;

    foreach ($feeByPropertyType as $row)
    {
        $data[] = [
            'property_type_id' => $row['property_type_id'],
            'fee_value' => $row['fee_value'],
            'product_service_id' => 1
        ];
    }

    PaymentTypeProductService::insert($data); 

Any help from the community will be greatly appreciated, on how to correct this. Thanks

23 Mar
3 months ago

shahzadsarwar left a reply on Laravel 5.7 Papertrail

That package is obsolete, I solved the issue. :)

shahzadsarwar started a new conversation Laravel 5.7 Papertrail

Hello,

I would really appreciate if anyone can guide me setting up the papertrail for logging.

21 Mar
3 months ago

shahzadsarwar left a reply on Show Only Related Data In Search Filter

?street= returns the results of street. What I'm trying to achieve is ?street=1&house=abc, to show only the house related data, but it should be in street 1.

shahzadsarwar left a reply on Show Only Related Data In Search Filter

@MANELGAVALDA - Thank you I did apply that. Is it possible to display the property data after the search, as it just returns the street. such as ?street=b-34&house=21

shahzadsarwar started a new conversation Show Only Related Data In Search Filter

trying to apply a search filter.

$streets = (new PropertyStreet)->newQuery();

    if ($request->has('street')) {
        $streets->where('name', 'like', '%'.$request->street.'%');
    }

    if ($request->has('house')) {
        $streets->whereHas('properties', function ($query) use ($request) {
            $query->where('house_number', $request->house);
        });
    }

    return $streets->get();

it gets the street data I want to do something like this ?street=b-34&house=21 and to display the house data, only as of right now it get's only street.

03 Mar
3 months ago

shahzadsarwar started a new conversation Laravel Must Verfiy Email With Tenancy.

Hi, Any help would be really appreciated.

I'm using hyn/multi-tenant. I'm trying to register the user account with tenancy in placed. The user does get registered & the email is sent to them. The email looks like the following.

http://example.com/email/verify/1?expires=1551615525&signature=b389f8c5d25c426c966ba0092ee062ab4e3febaebab5dcfd083549c7c2362150

When the user clicks on it, the account doesn't get activated.

The user will have to log in to there dashboard, and resend the verification email from http://abc.example.com, then the URL is generated correctly and the account is activated successfully.

http://abc.example.com/email/verify/1?expires=1551615525&signature=b389f8c5d25c426c966ba0092ee062ab4e3febaebab5dcfd083549c7c2362150

My actual question is can we modify or hook into URL::temporarySignedRoute? to add the sub-domain name inside the URL? so it should look like http://abc.example.com

10 Oct
8 months ago

shahzadsarwar left a reply on Query Scopes For Reservation System With Multiple Rooms.

Thank you so much for identifying that bigger problem. I will look into it and will try to solve it.

shahzadsarwar started a new conversation Query Scopes For Reservation System With Multiple Rooms.

I am working on a hotel reservation system, where user|admin can select multiple rooms. I am facing a problem in the edit functionality. I am looking for help and suggestions on how to make this right.

My schema.

Rooms:

  1. room_number
  2. price
  3. reserved(Boolean)

Reservations:

  1. customer_id
  2. checkin
  3. checkout

Reservation_Room

  1. room_id
  2. reservation_id
  3. TotalPrice

Query scope on rooms

public function scopeIsNotReserved($query) { return $query->where('reserved', false); }

The actual problem is.

  1. I cannot use IsNotReserved query scope while editing a reservation, because it won't pass the value to the selected options.
  2. I would like to pass all the rooms that are not reserved except this reservation.id(See $roomId)

My controller edit function looks like this.

$reservation = Reservation::findOrFail($id);

$customers = Customer::pluck('name', 'id')->toArray();

// Currently not doing anything with this query.

$roomId = $reservation->rooms()->pluck('rooms.id')->toArray();

$rooms = Room::IsNotOnMaintainance()->get();