murph133

murph133

Member Since 1 Year Ago

Experience Points 500
Experience
Level
Lessons Completed 3
Lessons
Completed
Best Reply Awards 0
Best Answer
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.

16 Oct
3 months ago

murph133 left a reply on Laravel Eloquent Sort By Related Field

The ordering methods mentioned above did not work for me using Laravel 5.6

However, I found a solution to orderBy a relation model using counts.

I wanted to order my business listings by their membership_level:

  1. Premium Plus
  2. Premium
$businesses = Business::withCount('subscription_premium_plus')->withCount('subscription_premium_plus')->orderBy('subscription_premium_plus_count', 'desc')->orderBy('subscription_premium_count', 'desc')->get();

Then I had two methods in my Business model:

public function subscriptionPremiumPlus()
{
    return $this->hasOne('App\Subscription')->where('end_date', '>', Carbon::now())->where('membership_level', 2);
}
public function subscriptionPremium()
{
    return $this->hasOne('App\Subscription')->where('end_date', '>', Carbon::now())->where('membership_level', 1);
}

My personal code actually included another relationship, but I have simplified things so you get the basic idea of what I did. Using the custom relationship methods also allowed me to add conditionals, such as checking whether the subscription was still valid.

13 Jun
7 months ago

murph133 left a reply on Very Very Slow Query...how To Speed Up

Make sure you have indexes on your tables.

$table->index('user_id'); // Example migration code

Add the indexes and test again to see if there's a performance difference. My load time dropped by over 50%, when I added indexes to the related tables that were being used for the withCount.

19 May
7 months ago

murph133 left a reply on BindingResolutionException In Container.php

@rawrkats I had exactly the same.

Change:

protected function __construct()

to

public function __construct()

murph133 left a reply on BindingResolutionException And Target Is Not Instantiable

I did not find the solution, but using a different controller worked. So that's an option, if you're pressed for time.

08 May
8 months ago

murph133 left a reply on [Laravel 5.4] How To Get The Current HTTP Status Code In 404 Error Page?

I am having the same problem. Cannot find a solution. Laravel is therefore returning a "soft 404", which is bad practice, according to Google.

07 May
8 months ago

murph133 left a reply on [Guide 5.2.x] Make Session Work In Error Pages

Thank you, great help.

I also had to move \Illuminate\View\Middleware\ShareErrorsFromSession::class,

04 May
8 months ago

murph133 left a reply on TokenMismatchException With Big Files

Solution:

Yes, you need to update your php.ini file.

Yes, increase the upload_max_filesize and post_max_size, but ALSO increase the max_execution_time.

I had a problem when a user tried to upload a 13mb image. When I increased the max_execution_time from 30 to 90 seconds, this resolved the issue.

12 Feb
11 months ago

murph133 left a reply on Give An Email A Subject!

If you want to use a variable from your model in subject(), just do the following:

return $this->markdown('event.approved')->subject("Your event is live: ". $this->event->title);

In this case, we're sending them an email when the event has been approved and made like. We add the event title into the email subject.

murph133 left a reply on Object Of Class App\Mail\PasswordRecovery Could Not Be Converted To String

I had the same problem when I tried to use the preview.

The reason: my version of Laravel is 5.4, not 5.5!

This feature is not available in 5.4.

Instead, in my routes, I returned the view with the data, rather than the class.

01 Feb
11 months ago

murph133 left a reply on Error 500 In Laravel On Shared Hosting

I recommend checking the server error logs.

I discovered the follow error: SoftException in Application.cpp:261: File "/home/wpwfcom/public_html/my_project_name/index.php" is writeable by group

When I changed the file permission of the index.php file from 664 to 644, this resolved this particular problem. No more 500 error.

17 Aug
1 year ago

murph133 started a new conversation Spark > Cashier > Stripe > Subscriptions: Changing The Default Address Country

The default subscription country for Stripe is US.

I want to change this to GB - for the United Kingdom, where all of my customers are based.

I have tried to customise this by changing a few view files that were hardcoded with the "US" as the default country.

I ran "npm run dev" after every edit.

No change in the Stripe logs for the new subscriptions I set up.

murph133 left a reply on Spark - Invoices Not Generating

To receive invoices, you require a Stripe webhook:

https://dashboard.stripe.com/account/webhooks

Example "URI to be called":

https://yourwebsite.com/webhook/stripe

The same applies for Braintree.

14 Aug
1 year ago

murph133 left a reply on [L5] Avoiding CSRF Middleware On API POST Routes

Thank you @billmn.

I had a problem integrating a GoCardless API into Laravel 5.4.

My server was responding with a 500 internal server error.

Adding the uri of my webhook to /Middleware/VerifyCsrfToken.php solved the problem.

07 Aug
1 year ago

murph133 left a reply on SQLSTATE[42S01]: Base Table Or View Already Exists: 1050 Table 'users' Already Exists

Step 1

php artisan migrate:reset

Step 2

Go to your database using PHPmyadmin (or similar) and delete all remaining tables - including the migration table.

Step 3

php artisan migrate
30 Jul
1 year ago

murph133 left a reply on ErrorException In Helpers.php Line 582: The Mix Manifest Does Not Exist.

The approach of mrad worked for the me.

Thank you!