SilverGround

Member Since 2 Weeks Ago

Experience Points
2,430
Total
Experience

2,570 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
21
Lessons
Completed
Best Reply Awards
0
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 [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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 1
2,430 XP
Dec
02
2 days ago
Activity icon

Replied to Data From Controller To View Vanishing

What do you mean ?

Activity icon

Replied to Data From Controller To View Vanishing

Thanks for your replies, I'm going to take a look at the documentation you sent me.

$menus is a table in my database where I have all my navigation menus. I'm trying to have my navigation appearing in all my views

Activity icon

Replied to Data From Controller To View Vanishing

Then it tells me that $menus is not defined

Activity icon

Replied to Data From Controller To View Vanishing

I didn't use Markdown correctly, now you have my code

Activity icon

Started a new Conversation Data From Controller To View Vanishing

Hi there, I'm trying to pass data from a Controller to a View and it's not working.

The data I'm trying to pass is from a variable called $menus .

When I do dd($menus) in my Controller it works fine but when I try to use that data in my View, it's apparently empty.

My controller :

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\MenuController;


class UserController extends Controller
{

    public function index_view()
    {
        $menus = MenuController::index();
        return view('pages.user.user-data', [
            'user' => User::class,
            'menus' => $menus,
        ]);
    }
}

My view :

@inject ('menus', 'App\Http\Controllers\UserController' )

<div>
    <ul>
        @foreach ($menus as $menu)
        <p>test</p>
        @endforeach
    </ul>
</div>

When i do a var_dump($menus) in my view it shows :

object(App\Http\Controllers\UserController)#1398 (1) { ["middleware":protected]=> array(0) { } }

Any idea why it's doing that ? Are middlewares involved in this ?

Dec
01
3 days ago
Activity icon

Replied to Create A Sidebar Menu With Fontawesome Icon And Menu Name

Alright thanks for answering so fast !

Despite these changes, my View "admin-dashboard"

<x-app-layout>
    <x-slot name="header_content">
        <h1>Admin Dashboard</h1>
        <div class="section-header-breadcrumb">
            <div class="breadcrumb-item active"><a href="#">Dashboard</a></div>
            <div class="breadcrumb-item"><a href="#">Layout</a></div>
            <div class="breadcrumb-item">Default Layout</div>

        </div>
    </x-slot>
</x-app-layout>

doesn't display my menu component :

@inject ('menus', 'App\Http\Controllers\MenuController')

<div id="sidebar">
    <ul>
        @foreach ($menus as $menu)
        <li>
            <a href="{{$menu->iconLink }}"><i class="{{ $menu->icon }}"></i>{{ $menu->navText }}</a>
        </li>
        @endforeach
    </ul>
</div>

There are no errors messages displayed either

Activity icon

Replied to Create A Sidebar Menu With Fontawesome Icon And Menu Name

Hi, I've watched the videos and it turns out that the episode 18 is the one I need but I don't succeed in displaying my menu on my view.

So far I now have MIGRATION :

 public function up()
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->id();
            $table->string('navText'); 
            $table->string('icon'); 
            $table->string('href'); 
            $table->timestamps();
        });
    }

CONTROLLER :

 <?php

namespace App\Http\Controllers;

use DB;
use Illuminate\Http\Request;

class MenuController extends Controller
{
    public function showMenus()
    {
        $menus = DB::table('menus')->get();
        return view("dashboard", ['menus' => $menus]);
    }
}

VIEW :

@inject ('menus', 'App\Http\Controllers\MenuController')
{{$menus['NavText']}}

<div id="sidebar">
    <ul>
        @foreach ($menus as $menu)
        <li>
            <a href="{{$menus -> href }}" <i class="{{ $menu -> icon }}">{{ $menu -> navText }}</i>
            </a>
        </li>
        @endforeach
    </ul>
</div>

In my database I have


ID     navText 		 icon 			 href 
1	Dashboard	fas fa-archway	/dashboard
Nov
30
4 days ago
Activity icon

Started a new Conversation Is It Possible To Use Google Drive's Api To Display Content With Laravel ?

Hi, I have around 200 videos on a drive and I wonder if I can display them on my website with an api ? Instead of downloading them and putting them into my website's assets

Any idea on how to do this ?

Nov
27
1 week ago
Activity icon

Started a new Conversation Create A Sidebar Menu With Fontawesome Icon And Menu Name

Hi there, I would like to create a dynamic sidebar menu with a fontawesome icon on the left and the menu's name next to it.

So far i've created a table named "sidebar_nav"

public function up()
    {
        Schema::create('sidebar_nav', function (Blueprint $table) {
            $table->id();
            $table->string('navText');
            $table->string('iconLink');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('sidebar_nav');
    }
}

I think I need a controller to manage my menu and return it to a view so then I can choose what Icon and Text I want to add to my menu but I currently have no idea on how to do this.

Can someone help me ?

Nov
18
2 weeks ago
Activity icon

Started a new Conversation Separate Admin/User Dashboard With Laravel Jetstream

Hi ! I'd like to have an admin dashboard which would have access to User's information. I'm using Laravel8 Jetstream. I've set my database

            $table->boolean('is_admin')->default(false);

and I don't know what to do next ! Can someone enlighten me ?

Thanks a lot !

Nov
17
2 weeks ago
Activity icon

Replied to Customize Laravel 8 Jetstream Register Form

It works now ! Thanks a lot

Activity icon

Started a new Conversation Customize Laravel 8 Jetstream Register Form

Hi there ! I would like to add fields to the Jetstream Register form like "phone" but I'm stuck with the validation process : When i register it tells me that Method Illuminate\Validation\Validator::validatePhone does not exist.

How can I fix this ? Has anyone encountered this before ?

Thanks a lot for reading !

public function create(array $input)
    {
        Validator::make($input, [
            'name' => ['required', 'string', 'max:255'],
            'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
            'phone' => ['required', 'string', 'phone', 'max:255', 'unique:users'],
            'password' => $this->passwordRules(),
        ])->validate();

        return User::create([
            'name' => $input['name'],
            'email' => $input['email'],
            'phone' => $input['phone'],
            'password' => Hash::make($input['password']),
        ]);
    }
}