GeorgeW

GeorgeW

Member Since 4 Years Ago

Experience Points
3,750
Total
Experience

1,250 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
13
Lessons
Completed
Best Reply Awards
3
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 supp[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 1
3,750 XP
Jul
28
2 weeks ago
Activity icon

Awarded Best Reply on Nested Select In Eloquent

Managed to fix this with the following:

Lead::select(DB::raw('AVG(`count`)'))
            ->from(DB::raw('(SELECT COUNT(created_at) AS `count` FROM leads
                WHERE `duplicate` IS NOT NULL
                AND `source_id` = 5
                AND `created_at` >= "'. Carbon::now()->startOfMonth() .'"
                AND `created_at` <= "'.$this->date.'" group by day(created_at)) nested')
                )->get();
Activity icon

Replied to Nested Select In Eloquent

Managed to fix this with the following:

Lead::select(DB::raw('AVG(`count`)'))
            ->from(DB::raw('(SELECT COUNT(created_at) AS `count` FROM leads
                WHERE `duplicate` IS NOT NULL
                AND `source_id` = 5
                AND `created_at` >= "'. Carbon::now()->startOfMonth() .'"
                AND `created_at` <= "'.$this->date.'" group by day(created_at)) nested')
                )->get();
Activity icon

Started a new Conversation Nested Select In Eloquent

Hi,

Im having trouble with the following query, i cant seem to figure out how to get it working using query builder. The nested select it the main thing thats confusing me.

Thanks for any advice.

SELECT
	AVG(`count`) AS average
FROM (
	SELECT
		COUNT(created_at) AS `count`
	FROM
		leads
	WHERE
		`duplicate` IS NOT NULL
		AND `source_id` = 5
		AND `created_at` >= '2020-07-01 00:00:00'
		AND `created_at` <= '2020-07-27 23:59:00'
	GROUP BY
		day(created_at)) nested
May
12
3 months ago
Activity icon

Replied to Paginate Only Returns Three Products

@swimmer your $pagi_jump variable is set to 3 and your passing this into categorie::paginate($pagi_jump); so ofcourse you will only see 3 items per page.

Mar
25
4 months ago
Activity icon

Replied to View Count On Forum

@jlrdw becuase everytime you refresh the page on a post the view count +1

Feb
27
5 months ago
Activity icon

Replied to Yajra DataTables : Unable To Load Data In Tables

I think your code needs to go in

public function ajax(){

}

Also check out this implementation: https://w3path.com/laravel-6-ajax-crud-tutorial-using-datatables-from-scratch/

They are using a resource

Activity icon

Replied to Yajra DataTables : Unable To Load Data In Tables

@matheenulla i think moving

 $data = DB::table('clients')->orderBy('id', 'desc')->get();
        return Datatables::of($data)
        ->addColumn('actions','buttons.clients')
        ->rawColumns(['actions'])
        ->addIndexColumn()
        ->make(true);

into

public function ajax()
{

}

should sort your issue.

You can also try wrapping your $data = ... in the following:

 if(request()->ajax()) {



}


Feb
26
5 months ago
Activity icon

Awarded Best Reply on Load And Populate 2 Textboxes Based On Dropdown Selection

First you'll need to add id="max_score" and id="total_weighted_score" to your 2 inputs.

And instead of 2 endpoints just have 1 and put both bits of logic in there?

$(document).ready(function(){

    $("#goal_type").on('change', function postGoalType(){

        var goal_type_id = $(this).val(); 

        $.ajax({ 
            url: 'appraisal_goals/getScores', //your endpoint
            data: { goal_type_id: goal_type_id }, //data being passed
            type: 'post'
        }).done(function(responseData) {

          $('#max_score').val(responseData.maxscore); //populate the max_score input
      $('#max_score').val(responseData.totalweightedscore); //populate the total_weighted_score input

        }).fail(function() {

            console.log('Failed');

        });
    });

}); 

In your controller method after your logic you should return the following:

return response()->json([
    'maxscore' => $maxScore,
    'totalweightedscore' => $totalWeightedScore
]);
Feb
25
5 months ago
Activity icon

Replied to Load And Populate 2 Textboxes Based On Dropdown Selection

First you'll need to add id="max_score" and id="total_weighted_score" to your 2 inputs.

And instead of 2 endpoints just have 1 and put both bits of logic in there?

$(document).ready(function(){

    $("#goal_type").on('change', function postGoalType(){

        var goal_type_id = $(this).val(); 

        $.ajax({ 
            url: 'appraisal_goals/getScores', //your endpoint
            data: { goal_type_id: goal_type_id }, //data being passed
            type: 'post'
        }).done(function(responseData) {

          $('#max_score').val(responseData.maxscore); //populate the max_score input
      $('#max_score').val(responseData.totalweightedscore); //populate the total_weighted_score input

        }).fail(function() {

            console.log('Failed');

        });
    });

}); 

In your controller method after your logic you should return the following:

return response()->json([
    'maxscore' => $maxScore,
    'totalweightedscore' => $totalWeightedScore
]);
Activity icon

Replied to Load And Populate 2 Textboxes Based On Dropdown Selection

Hi @noblemfd, it would probably be best to use jquery and ajax to retreive the max_score and employee_score from your database.

$(document).ready(function(){

    $("#goal_type").on('change', function postGoalType(){

        var goal_type_id = $(this).val(); 

        $.ajax({ 
            url: '', //your endpoint
            data: { goal_type_id: goal_type_id },
            type: 'post'
        }).done(function(responseData) {

            console.log('Done: ', responseData); 

        }).fail(function() {

            console.log('Failed');

        });
    });

}); 

You will need to create the api endpoint to handle the logic in the backend and the return the data.

Feb
24
5 months ago
Activity icon

Replied to Delete Record By Selecting Option In Dropdownlist With A Delete Link.

@alicechan98 Your <a href = 'deleteroom/{{ $value->roomCode }}'>Delete</a> is outside of your @foreach. You might be better off using javascript to dynamically set the value within your <a href = 'deleteroom/{{ $value->roomCode }}'>Delete</a> when a new option is selected

Feb
20
5 months ago
Activity icon

Replied to Recursive Menu

@sinnbeck Thankyou!

Activity icon

Started a new Conversation Recursive Menu

My Tags Model has the following:

public function childrenRecursive()
    {
        return $this->children()->with('childrenRecursive');
    }

This works fine and gives me the children recursivley of each tag.

I am trying to build a menu using this and am using the following to test:

 @foreach(App\Tag::all() as $tag)
    - {{$tag->name}} <br />
        @foreach($tag->childrenRecursive as $item)
        -- {{ $item->name }} <br />
            @foreach($item->childrenRecursive as $item)
            ----- {{ $item->name }} <br />
            @endforeach
        @endforeach
    @endforeach

But instead of having to add a foreach manaully for a new child level is there a way to do it dynamically?

Thankyou in advance!

Feb
14
6 months ago
Activity icon

Awarded Best Reply on Is It Simple Or At Least Possible To Run Vanilla PHP Projects In A Laravel Valet Environment?

@greevesh Its super easy and just works with vanilla php or frameworks. After running valet park and then creating a new directory for your vanilla php site you can access it as you would a laravel site.

Feb
13
6 months ago
Activity icon

Replied to Is It Simple Or At Least Possible To Run Vanilla PHP Projects In A Laravel Valet Environment?

@greevesh Its super easy and just works with vanilla php or frameworks. After running valet park and then creating a new directory for your vanilla php site you can access it as you would a laravel site.