You_ness654987

You_ness654987

Member Since 5 Months Ago

Experience Points
1,970
Total
Experience

3,030 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
17
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
1,970 XP
27 Apr
4 months ago

You_ness654987 left a reply on How To Obtain Data From Another Table Using Foreign Key In View?

@VAN1310 - thanks man when i did use

return $this->belongsTo('App\categorie','id');

it work as it should be

You_ness654987 left a reply on How To Obtain Data From Another Table Using Foreign Key In View?

@SNAPEY - yes i did try it but all categories name appears as '-'

You_ness654987 left a reply on How To Obtain Data From Another Table Using Foreign Key In View?

@VAN1310 - compact also did give me the same erreur penalty model it in the post above

You_ness654987 left a reply on How To Obtain Data From Another Table Using Foreign Key In View?

@SNAPEY - all penalties have category when i use: (id_category is my foreign key)

<td>{{$item->id_category}}</td>

it work normal but when ii use

  <td>{{$item->categorie->name}}</td>

i get that erreur

You_ness654987 started a new conversation How To Obtain Data From Another Table Using Foreign Key In View?

hi every one am trying to obtain value from foreign key but i get this erreur Trying to get property 'name' of non-object

here is my model

namespace App;

use Illuminate\Database\Eloquent\Model;

class penaltys extends Model
{

    public function categorie()
    {
        return $this->belongsTo('App\categorie');
    }
}

controller method

public function index()
    {

        $penaltys = penaltys::all();

        return view('vendor.multiauth.admin.pages.penaltys.index')->with('penaltys', $penaltys);
    }

and here my view

  @foreach ($penaltys as $item)
                                <tbody>
                                    <tr>
                                        <th scope="row">{{$item->id}}</th>
                                        <td>{{$item->categorie->name}}</td>
                                        <td>{{$item->penalty}}</td>
                                       
                                    </tr>
                             
                                </tbody>
 @endforeach

12 Apr
5 months ago

You_ness654987 left a reply on 404 Not Found

thank you it work

You_ness654987 left a reply on 404 Not Found

@STEREOH - here is it

Route::resource('/shop', 'shop_con');

You_ness654987 started a new conversation 404 Not Found

Hi to all, Can you help me with this problem. i did pass parameter parameter from url to controller when i type the link (...//shop?category=2) it work normal but when i want to access the link ( ../shop ) without parameter i get 404 not found

my controller :

 public function index()
    {

        $category_id = request()->category;


        $categories = categories::all();
        if (empty($category_id)) {

            $products = products::inRandomOrder()->take(12)->get();
        } else {
            $products = products::where('categories_id', $category_id)->inRandomOrder()->take(12)->get();
        }

        $cat_name = categories::where('id', $category_id)->firstorFail();




        return view("shop")->with([
            'products' => $products,
            'categories' => $categories,
            'cat_name' => $cat_name,
        ]);
    }
09 Apr
5 months ago

You_ness654987 left a reply on Seeder Problem

@FTIERSCH - thank you ftiersch . that makes sense

07 Apr
5 months ago

You_ness654987 started a new conversation Seeder Problem

hello, i have seeder problem exactly in json field. when i seed with a cast in my model

class product extends Model
{
    protected $casts = [
        '_tags' => 'array'
    ];
}

it appears as a string in my data base : "{ "auth":"auth1"}"

but when i get ride of the cast it appears like this : { "auth":"auth1"}

seeder class code (_tags it's json field )

 for ($i = 1; $i <= 9; $i++) {
            Product::create([
                'title' => 'Boook ' . $i,
                'description' => 'this book is amazing by it now-' . $i,
                '_tags' => '{
                            "img_path":["img/movies/' . $i . '.jpg"],
                            "auth":"auth' . $i . '" ,
                            "genre":"genre' . $i . '"
                                }',

                'price' => rand(0, 249999),
                'promo_price' => rand(0, 249999),
                'stars' => 2,
                'quantity' => rand(0, 200),
                'disp' => rand(true, false),



            ]);
        }