evaslims23

evaslims23

Member Since 5 Months Ago

Experience Points
190
Total
Experience

4,810 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
0
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
190 XP
Aug
13
4 months ago
Activity icon

Started a new Conversation Decimal Number In Form Validation/Insertion

Hi people. I want to automatically output a decimal number on insertion in a form. Let's say a person would like to insert the number 1000,00. What I want is after he types in 1 in the form the number to convert automatically to a decimal e.g. 1,00 and if he adds another 0 to then make it a 10,00 and so on.

The value is integer in the database and I am using a function to convert the integer to a decimal so I can display it in the frontend. So technically if the person has 15,99 product let's say the value in the database would be 1599. This I got covered, however the issue above I have not. Any ideas?

Jul
19
4 months ago
Activity icon

Started a new Conversation Validation: Ignore An ID From Table

So I have a table of countries: 1.USA 2.China 3.Russia

I want to make it so that if the user selects USA it returns an error so he should select a different country. How do I make such a rule?

public static $rules = array(
'location_id'=>'required|integer',
);
Jul
17
4 months ago
Activity icon

Replied to BelongsToMany Trying To Get Property 'id' Of Non-object Error

@munazzil I'm getting the same thing.

Collection {#290 ▼
#items: array:5 [▼
0 => Country {#292 ▶}
1 => Country {#129 ▶}
2 => Country {#299 ▶}
3 => Country {#295 ▶}
4 => Country {#305 ▶}
]
}

Here is the entire contents: https://imgur.com/a/aSyc3RZ

Activity icon

Replied to BelongsToMany Trying To Get Property 'id' Of Non-object Error

@tray2 i have posted the output above ur reply <3

Activity icon

Replied to BelongsToMany Trying To Get Property 'id' Of Non-object Error

@munazzil I am such a noob I did it in the views.. Here is what I get:

array:5 [ 1 => "Worldwide" 2 => "European Union" 3 => "N. and S. America" 4 => "South Africa" 5 => "Asia" ]

Activity icon

Replied to BelongsToMany Trying To Get Property 'id' Of Non-object Error

@munazzil doing this creates a different error:

"Too few arguments to function Illuminate\Support\Collection::get(), 0 passed in \app\Http\Controllers\AdminProductsController.php on line 45 and at least 1 expected"

@tray2

doing this returns: "dd($country) dd($country) dd($country) dd($country) dd($country)"

Activity icon

Started a new Conversation BelongsToMany Trying To Get Property 'id' Of Non-object Error

Hi guys. I am trying to add a belongsToMany functionality to my project for Countries and Products. As in if a user decides to create a product listing he can have the option to choose many countries or destinations where he can ship the product.

My Country model:

public function products(){
    return $this->belongsToMany(Product::class);
}

My Product model:

public function countries(){
    return $this->belongsToMany(Country::class);
}

My AdminProducts Controller:

public function create()
{
    //

    $categories = Category::pluck('name', 'id')->all();
    $countries = Country::pluck('name', 'id')->all();


    return view('admin.products.create', compact('categories', 'countries'));
}

And my create.blade.php:

<div class="form-group">
     <label class="control-label">Shipping to:</label>
     
     <select name="countries" id="countries" class="form-control" multiple="">
       @foreach($countries as $country)
        <option value="{{$country->id}}">
          {{$country->name}}
        </option>
       @endforeach
     </select>
     
   </div>

What am I doing wrong? When I visit the page in this form I receive the following error:

ErrorException (E_ERROR) Trying to get property 'id' of non-object (View: C:\xampp\htdocs\webmarket\resources\views\admin\products\create.blade.php)

The relationship works I tested it beforehand. What might be the cause of this error? Thank you in advance and sorry for the silly question I am new to laravel and programming as a whole!

Also these are my tables:

https://imgur.com/a/CdDqTTu

countries, country_product and products