dragoneyes96

dragoneyes96

Member Since 7 Months Ago

Experience Points
2,380
Total
Experience

2,620 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
4
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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 1
2,380 XP
Mar
15
7 months ago
Activity icon

Replied to Getting My Query To Look At The Year

You should check for 'whereYear' method for checking records that has that year (https://laravel.com/docs/5.8/queries)

Mar
14
7 months ago
Activity icon

Replied to Trying To Get Property Of Non-object

Your query should be

$information=Registration::with('followups')->findOrFail($id);

Remember to declare relationship in registration model. And in blade use null coalesce operator

Activity icon

Replied to Subdomain Validation Using Regex Not Wokring

There is duplication when you declare rules for domain_name. You must declare it once

$request->validate([
        'domain_name' => [
            'required',
            'unique:real_domains',
            'regex:/^([a-zA-Z0-9][a-zA-Z0-9-_]*\.)*[a-zA-Z0-9]*[a-zA-Z0-9-_]*[[a-zA-Z0-9]$/',
]
]);
Activity icon

Replied to Foreign Key Constraint Is Incorrectly Formed

  1. Are the migrations is in the correct order: Migrate users table first then projects table
  2. Try to change $table->unsignedInteger('owner_id');to $table->unsignedBigInteger('owner_id');
Activity icon

Replied to Discovering How To See What Relationships Are Passed With Variable

@chrisgrim Well i think in controller, you should use

$event->load('categories')

to eager loading relationship. So that you can use later in blade

Activity icon

Replied to Discovering How To See What Relationships Are Passed With Variable

@chrisgrim Can you check if in categories table, the record with id = 6 is existed? Or if this is in a loop, you can check @snapey reply

Activity icon

Replied to Discovering How To See What Relationships Are Passed With Variable

Its because $event does not belong to any category. If you dd($event->categories), it will return null

Mar
13
7 months ago
Activity icon

Replied to Help With A Relationship Spanning Multiple Tables

I think you should read this https://laravel.com/docs/5.8/eloquent-relationships#many-to-many

About your question, in your Shop model:

public function reviewSites() {
    return $this->belongsToMany('App\ReviewSite', 'review_url', 'shop_id', 'site_id');
}

And your controller:

$shops = Shop::with('reviewSites)'->get()

Hope this can help

Mar
12
7 months ago
Activity icon

Replied to How Can I Load The Value From The Database Into Input On Update?

What is your $course like? Is it has 'title' attribute? You can change $course->title to anything you want as default value of input

Activity icon

Replied to VUE.js | Display Photos From Storage

You misspelled img's src. It should be

<img class="img-responsive" :src="photo.path"  style="width:30px; height:auto;"/>
Activity icon

Replied to How Can I Load The Value From The Database Into Input On Update?

old() can have 2nd parameter is your default value for input. For example:

old('title', $course->title)
Mar
11
7 months ago
Activity icon

Replied to Call To A Member Function Diff() On String

@akmahato That's because $fromData is currently string. Try this:

$difference = $date->diff(Carbon::parse($fromData));

Activity icon

Replied to Call To A Member Function Diff() On String

$date = Carbon\Carbon::now()->toDateTimeString(); should be $date = Carbon\Carbon::now(); so that you can use diff()

Activity icon

Replied to Method Illuminate\Database\Eloquent\Collection::orderBy Does Not Exist.

  1. This line
$order->transform(function($order, $key){ ... })

Is $order should be $orders

  1. Try using sortByDesc('order_date') instead of orderBy('order_date', 'desc')
Activity icon

Replied to Custom Validation Rule And Regex

I think this is not the best solution but you can try this

$rules = [
    'date'                => 'required|date',
    'order_total'        => 'required|integer',
];

if ($request->input('order_total') > 100000) {
    $rules = array_merge_recursive($rules, [
        'before_screenshot' => 'required|regex:/^https:\/\//m'
    ];
}

$this->validate($request, rules)
                        
Mar
08
7 months ago
Activity icon

Replied to Getting The Sum Of Qty * Rate

$po_totals = $po_total;

This should be

$po_totals[] = $po_total;

Or if you want more clearly, your $po_totals can be like this: (assume that po have unique key is "id")

$po_totals[$po->id] = $po_total;

Activity icon

Replied to Only Displaying Categories That Have Events In The Controller

The one you need is:

$categories = Category::whereHas('events')->latest()->get();

This will only get categories that have events (1 or more)