G
G
Goobert Crypto2020-06-28 14:40:15
Laravel
Goobert Crypto, 2020-06-28 14:40:15

How to make a form in which the admin can add elements, and the user will use these new elements?

Please tell me the idea of ​​how I can add new elements in the pop-up form (buttons, input window ... etc.) So that these elements can be seen through the admin panel, and for example, these buttons would not be visible to the user, how to implement? ?)))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
f0kusn1k, 2020-07-02
@f0kusn1k

You do this in the User model

public function isAdmin() 
{
   return $this->roles()->where('role_id', 1)->first();
}

In blade it
@if (auth()->check())
   @if (auth()->user()->isAdmin())
      Admin
   @else
      User
   @endif
@endif

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question