BlindPilot Posted April 17, 2020 Report Share Posted April 17, 2020 Hi Guys, i think i made a mystake. Change the role of my first user. I.ve activated Adminpanel and all the checkboxes after creating a new role. But now when i.m logged in into the website i can.t select "admin" only "Profile" and "log out". Is there a chance to set back the role or have i to make a complete new installation? Thanks for Help. Quote Link to comment Share on other sites More sharing options...
web541 Posted April 17, 2020 Report Share Posted April 17, 2020 There's a thousand ways to do this, but this would be easiest to explain: 1. Go to this file and after this line https://github.com/nabeelio/phpvms/blob/dev/app/Http/Controllers/Frontend/HomeController.php#L16 Put this User::find(1)->attachRole('admin'); 2. Go to your home page (http://siteurl.com/) and refresh the page and it should be there again. 3. Remove the line of code This is assuming you are User number 1 in your database (id of 1 in the users table). There are other ways to do it such as putting it in the routes file, editing the database tables (but not recommended as it adds it into a few), using the Auth::user() instead once you are logged in. 1 Quote Link to comment Share on other sites More sharing options...
BlindPilot Posted April 18, 2020 Author Report Share Posted April 18, 2020 11 hours ago, web541 said: There's a thousand ways to do this, but this would be easiest to explain: 1. Go to this file and after this line https://github.com/nabeelio/phpvms/blob/dev/app/Http/Controllers/Frontend/HomeController.php#L16 Put this User::find(1)->attachRole('admin'); 2. Go to your home page (http://siteurl.com/) and refresh the page and it should be there again. 3. Remove the line of code This is assuming you are User number 1 in your database (id of 1 in the users table). There are other ways to do it such as putting it in the routes file, editing the database tables (but not recommended as it adds it into a few), using the Auth::user() instead once you are logged in. Thanks i.m now back in Quote Link to comment Share on other sites More sharing options...
Administrators Nabeel Posted April 19, 2020 Administrators Report Share Posted April 19, 2020 On 4/17/2020 at 11:17 AM, BlindPilot said: Hi Guys, i think i made a mystake. Change the role of my first user. I.ve activated Adminpanel and all the checkboxes after creating a new role. But now when i.m logged in into the website i can.t select "admin" only "Profile" and "log out". Is there a chance to set back the role or have i to make a complete new installation? Thanks for Help. You changed the role for your own user away from admin? I need to block that from happening... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.