dragoneyes96

dragoneyes96

Member Since 4 Months Ago

Experience Points 2,380
Experience Level 1

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.

15 Mar
4 months ago

dragoneyes96 left a reply on 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)

14 Mar
4 months ago

dragoneyes96 left a reply on 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

dragoneyes96 left a reply on 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]$/,
   ]
]);

dragoneyes96 left a reply on 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');

dragoneyes96 left a reply on 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

dragoneyes96 left a reply on 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

dragoneyes96 left a reply on 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

13 Mar
4 months ago

dragoneyes96 left a reply on 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

12 Mar
4 months ago

dragoneyes96 left a reply on How Can I Load The Value From The Database Into Input On Update?

What is your $course like? Is it has 'title' attribute?

dragoneyes96 left a reply on 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;"/>

dragoneyes96 left a reply on 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)
11 Mar
4 months ago

dragoneyes96 left a reply on Call To A Member Function Diff() On String

@akmahato That's because $fromData is currently string. Try this: $difference = $date->diff(Carbon::parse($fromData));

dragoneyes96 left a reply on 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()

dragoneyes96 left a reply on 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')

dragoneyes96 left a reply on 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)
                        
08 Mar
4 months ago

dragoneyes96 left a reply on 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;

dragoneyes96 left a reply on 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)