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

joshsalway

joshsalway

Member Since 1 Year Ago

Experience Points
52,700
Total
Experience

2,300 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
492
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 11
52,700 XP
Nov
13
1 week ago
Activity icon

Commented on How To Install PHP 8

Php 8?

Oct
28
3 weeks ago
Activity icon

Commented on Use Third-Party Providers

It says @2019 Twitch Interactive in the footer... are you a time traveller?

Jul
29
3 months ago
Activity icon

Started a new Conversation How To Speed Up This Eloquent Query In Laravel 5.2?

$countLeaseCommercial = DB::table('listings')
            ->join('properties', function ($join) {
                $join->on('listings.property_id', '=', 'properties.id')
                    ->where('properties.type', '=', 'Commercial')
                    ->where('listings.status', '=', 'Leased')
                    ->where('listings.user_id', '=', $this->user->id);
            })
            ->count();

How to speed up this query to be faster?

Jul
26
3 months ago
Activity icon

Started a new Conversation Laravel Mix (gulp) Running Really Slow?

npm run prod is taking 1.5 minutes to run on server and npm run dev isn't working as expected... What would you do to improve the speed? This is a laravel 5.2.45 project... Node v 8.11.2

package.json

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "gulp": "^3.9.1",
    "gulp-sass": "^3.1.0",
    "laravel-elixir": "^5.0.0",
    "bootstrap-sass": "^3.0.0"
  },
  "dependencies": {
    "@stripe/react-stripe-js": "^1.1.2",
    "@stripe/stripe-js": "^1.5.0",
    "@types/react": "^16.9.35",
    "natives": "^1.1.6",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-number-format": "^3.6.1",
    "react-stripe-elements": "^2.0.3",
    "rrule": "^2.2.9",
    "sortablejs": "^1.10.1"
  }
}
var elixir = require('laravel-elixir');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */
var path = require('path');
elixir(function (mix) {
    mix.browserify('./resources/assets/react/v2/v2.js', './public/js/react/v2.js', false, {
        // paths: [path.resolve(__dirname, 'resources/assets/js')]
        paths: ['./resources/assets/react/v2/']
    });

    mix.browserify('./resources/assets/react/vendor/v2_vendor.js', './public/js/react/v2_vendor.js', false, {
        // paths: [path.resolve(__dirname, 'resources/assets/js')]
        paths: ['./resources/assets/react/vendor/']
    });

    mix.browserify('./resources/assets/react/admin.js', './public/js/react/admin.js')
        .browserify('./resources/assets/react/agent.js', './public/js/react/agent.js')
        .browserify('./resources/assets/react/vendor.js', './public/js/react/vendor.js')
        .browserify('./resources/assets/react/public.js', './public/js/react/public.js')
        .sass('brandname.scss')
        .sass('public.scss')
        .sass('vendor.scss');
});
Activity icon

Started a new Conversation How To Restore Using Eloquent, With An Api With React? With Softdeletes

     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        $customer = Customer::withTrashed()->findOrFail($id);

        if($customer->deleted_at != null) {
            $customer->restore();
            return response()->json($customer);
        }

        $customer->first_name = $request->first_name;
        $customer->last_name = $request->last_name;
        $customer->email = $request->email;
        $customer->save();
        return response()->json($request);
    }

How do I restore a customer? If I'm using an API resource...

With SoftDeletes a deleted_at column is created and only a date is added...

This works is there any way you would improve this?

https://laravel.com/docs/7.x/eloquent#querying-soft-deleted-models