Member Since 2 Months Ago
2,520 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
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.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Started a new Conversation How Do You Have A Mobile App On Desktop ?
Hey guys, I'm developing a mobile app and I need it to be available on desktops. What's the best way to do that ? Create a desktop app, make a web version of the app ?
I'm sort of new into the app field so any tips are appreciated, thanks !
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
Replied to Data From Controller To View Vanishing
I didn't use Markdown correctly, now you have my code
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 ?
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
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
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 ?
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 ?
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 !
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']),
]);
}
}