Belajar Laravel Lebih Dari Sekedar Fundamental

Wisnu A. Wiyangga

Joined 21 December, 2021
We don't know much about them, but we're sure he is great someone.
2
Comments
1K
Total experiences
2
Lesson completed

Last Activity

Role & Permission with Admin PanelPeriksa yang punya peran12:25

Wisnu A. Wiyangga replied to Wisnu A. Wiyangga comment.

ada yang kurang, asign role di database , oke terimakasih tidak jadi hhe

Role & Permission with Admin PanelPeriksa yang punya peran12:25

Wisnu A. Wiyangga

bang tanya dong, kenapa fungsi hasanyrole / hasrole , saya ga jalan ya, menu navigation terhidden walaupun sudah saya login dengan user terautentifikasi sekalipun superadmin, menu navigation tetap tidak muncul

model/user.php use Spatie\Permission\Traits\HasRoles; use Illuminate\Notifications\Notifiable;

class User extends Authenticatable { use HasApiTokens; use HasFactory; use HasProfilePhoto; use Notifiable; use TwoFactorAuthenticatable; use HasRoles;

app/view/layouts/navigation.php namespace App\View\Components\layouts; use Illuminate\View\Component; use Spatie\Permission\Models\Role;

public function render() { $roles = Role::get(); return view('components.layouts.navigation', compact('roles')); }

resource/views/component/layouts/navigation.blade.php

@hasrole('SuperAdmin')

@endhasrole

Parsinta is a online learning platform intended for web developers.Through series-series such as Laravel, Reactjs, Vuejs, InertiaJs, HTML, Bootstrap, Tailwind CSS, and more.

Parsinta is a Trademark of Irsyad A. Panjaitan. Copyright © 2016 - 2022