Transcript for:
Laravel Admin Panel Installation Tutorial

Hello everyone, this is Yamin and in this tutorial I'm going to show you how you can install an admin panel in your Laravel project really easily. In order to install the admin panel, you just need to write three or four lines of command and your admin panel will be installed. And after that you'll be able to easily display, edit, delete or update any data in the admin panel. So I'll show you everything step by step from the very beginning. So this is the admin panel we'll create in this project.

So we'll be able to do a lot of things. in this admin panel. So I'll just create a face Laravel project right now. So let me just go to the file manager over here.

And let's say I'll create our project over here. So let me just write over here CMD, we just open a command prompt. And let's just get our face Laravel project we're going to server here Laravel new lesser product name will be Lara admin panel, you can give it any name.

So we'll just press Enter. So we didn't start getting our Laravel project. So right now, I'll just fast forward the video. So here you can see our project creation is complete.

And here is the project folder over here. So let's just run the project. So let's just go to the project directory. We'll say over here ct lara admin panel. Press enter.

So back here in the project directory. So let's run our project PSP artisan serve. So right now we'll just say this over here.

So this is our freshly created laravel project. So right now we are going to install a laravel package for this project. But before that we need to create our database and migrate our table, whatever table we have. So right now, let's just go and open another command prompt in the project directory.

So I'll just go inside the project over here. So right now let's just write over here CMD will just open a command prompt again over here and let's just write the command over here PHP artisan migrate so it will just migrate all the table we have and it will ask us would you like to create a database we'll just say over here yes and it will automatically create a database for us press enter so here you can see it just created some table and the database name will be our project name which is lara admin panel so let me just show you the xampp over here let's just go to the xampp dashboard over here pc my admin so this is our pc my admin so right now let's just find the lara admin panel so here you can see Lara admin panel and some table is migrated over here okay so our basic preparation is done so right now we'll install a package for our Laravel project to install admin panel so we are going to install open admin docs this is a Laravel admin panel and I'll give this link here you can see open admin dot org slash docs so I'll give this link in the description so that you can just check it out easily And here, after coming to this website, we need to come over here getting started and then installation part over here you can see installation. And if you click installation, it will show you three bound over here. So first one is composer require open admin or G slash open admin.

So we'll just copy this. And then we'll go to our command prompt over here, we'll just paste the command over here, which is composer require open admin or G slash open admin. So we'll press enter. So it will install require file for open admin.

So I'll again just pass for the video. So here you can see the command installation is done. So after this here we have another command which is this condition vendor published provider this one. So I'll copy this and again we'll just paste it over here and then press enter.

So it will create some file and folder in our project. So here you can see it will create a file or folder in the vendor. and it will also create some file in the public folder as well.

Okay so let me just show you I already opened my project using sublime text over here. So if I now go to the vendor over here we should have a folder over here called open admin. Here you can see open admin org and if you go to the public folder here you can see we have a vendor folder over here and inside vendor we have some two more folder admin open admin and open admin text.

Okay so right now after the second command, we need to give that third command here you can see PSP edition admin install. So if you write this command, what we do is that it will create some database table in our database, and it will create a table for admin over here. So here you can see it will create a table for admin and the username by default will be admin and password will be admin as well. So you can just change the password if you want. So we'll just copy this one from here, this condition admin install.

and then we'll just paste it in the command prompt press enter and here you can see that it created table and it also creates a folder in the app admin controller, home controller, auth controller and example controller. And there's also a few more file over here. Okay, so right now if we just refresh our PSC my admin over here, and here you can see there is some table over here, you can see admin roles, admin role menu and a lot of things. So right now, as you can see, it is mentioned what here we need. to go to the slash admin.

So here in our Laravel project, we'll just see over here slash admin and press enter. And here you can see to go to the login form. So over here, I'm going to write over here admin, and the password will be admin, just as it is mentioned over here.

Okay, so right now we'll just click login over here. And there you can see login is successful. And finally, we are in the admin panel or admin dashboard. So right now here you can see there is nothing over here.

So right now let's say if you want to show the user data over here, then we need to make some changes or we need to write some comments. So first of all, we can do this really easy using a few command over here. So here you can see in the getting started, we have quick start option over here. So if you click Quick Start, it will take us to this page. So you can see helper scaffolding here against the composer recur open admin helper.

And we just need to run these two commands. So if you do not want to run this to go on, then you have to do a lot of things in order to create some option in the admin panel. So running this to command is really easier for us.

So you just understand after a few minutes. So let me just copy this command, which is composer require open admin ext helper. So we'll copy this and we'll run it in our command prompt. And right now I'll just password the video. So you can see helper installation is done.

So after this, we'll run and one more command which is is variation. admin import helper. So let's just paste it over here, press Enter.

And there you can see it is also done as well. So right now here, if we just refresh our admin panel over here, there you can see there is nothing over here, we only have dashboard and admin over here. So if you just refresh over here, there you see we have one more thing over here, which is helpers.

So if you click helpers, it will show us a few more options over here. So the most important thing is this scaffold. So if you just click over here, here you can see table name, model controller and some more things. So it will let us create our table model and controller easily without writing any command or writing any code.

So here, let's say we have to create a table for students. So here we'll say student. And here we need to give the model.

So we'll say what here capital S T U D E N D student. here we we need to give that controller so it will also create a controller for us as well so we saw our here is T U T E N T student controller so here you can see create migration create model create controller run migration and create new menu so what it will do is that it will create a table model controller run the migration and also it will also create a menu over here for the student as well so right now one more thing we need to do is that we need to mention the field name over here. So let's say the field name will be named. And we'll click over here at file, then it will be email, again, click Add file.

And this one will be less a image. So we'll keep everything now over here. And by default, the primary Q will be ID over here. And here you can see get it that's sub delete. So we just directly give you our here sub adoption.

So if you know just click over here, the submit option here, you can see some file is created over here you can see and it is telling us to do one thing that is at the following routes to app admin route. So I'll just copy this router resource students to the controller class. So I'll just copy this and go to this location app admin routes.

So we just go to our project over here. And here you can see app inside app we have a folder called admin. And inside admin here we can see route start PHP.

So inside this route or PHP, we'll just paste over here, here you can see after this, we'll just paste it over here. So let's save this. And let me just show you one more thing.

If you go to the popular folder over here, here you can see student controller. So inside the student controller here you can see this is for showing the student data. This is for finding the details and this is for inserting data.

Okay, so right now Let's just go back to our browser over here. And if you now refresh over here, here you can see we have an option called student over here. So if you click student over here, there you can see it is showing us something over here.

So right now before we do anything, we need to on more thing. Some people may see a error over here. And even if you are not seeing any error over here for emails, it will give you a here.

So before that, we'll just go to our project over here. And in the project, we need to go to the config and inside config, we need to go to our file system dot php. And we'll just directly go down. And over here you can see this. So inside this, we need to add something.

for admin. So I just already write this inside this notepad over here and here you can see admin. So I'll just copy this from here.

And I'll paste it over here inside this is so we need to mention this admin. So over here we'll mention what we want to upload our file over here. So it will upload our file in the uploads folder in the public folder. So it will get the upper folder in the public folder. Okay.

So let's save this again. And let's refresh. Okay, there is no data over here.

So let's just add a data for the student table. So let me just refresh over here. And here you can see student let's just insert a random data over here.

Let's say name will be Yamin. Yamin at the rate of gmail.com it will be email so we keep the image field empty and we'll just click go over here. So right now if we refresh over here, you can see we can see the name and email option over here.

So right now can we insert data from here, here you can see new option. So right now if we click new, here you can see it is showing us the input field, email field and the choose file option for emails. So by default, it can understand that from here, it can understand that what kind of field it is needed to create for each input field. So if you want to modify some input field, you can obviously do this, you just need to change this from here. Okay, instead of image, you can see over here text or any kind of field.

Okay, so this is for the input field, whatever you are seeing over here three input field. So right now let's try to upload something let's see what here it will be Adam, email will be Adam, Adam at that of gmail.com. and let's just choose the image from here let's choose this image click open and we just click over here this submit option click submit and here you can see images successfully uploaded and here you can see the image so right now if we just want to edit the data if we just click over here we cannot see the image but we can update it so reason we cannot see the image is because here you can see this onto 7.0 dot on clone 8000. So I'll just copy this.

And right now we'll just go to our dot in be over here. And here you can see app URL HTTP logo. So instead of this, we'll paste it over here. And we obviously also need to remove this slash from here, make sure to remove the remove the slash.

Okay, so if we now save, then if we now refresh, we should be able to see that image over here. So right now, how do we need to do is that let's just go back, we need to show that image over here. So in order to show that image over here, we just need to make some changes in the student controller dot PHP. So for here, read column, we are basically showing the image. So this is the column name.

And this will be the image data basically. So instead of this, since you're show the image not a text. So we just remove this and I just write it over here, you can see grid column image image, let me just do mean this one. So I'll just copy this and paste over here. Okay, so this will let us see that image.

So if we now save this, then if we now refresh over here, there you can see you can see the image now this student table was created using the helpers now we already have a table called let's say user in our database now if you want to show that user data over here all you have to do is that go to the scaffold and we already have the table over here which is user so it's our yet user we measure the user model name then user controller over here user controller and here since we already have that user model uh user table and use a model so we don't need to get the migration get the model. So we just remove that sign from here. only create the controller. So we don't need the migration. So we only need to get the controller and the create menu.

So right now we'll just click over here submit option. And I guess everything is done. So we'll just copy this and we'll just paste it in the app, the admin, and then routes. So over here we paste it, save this, then let's just refresh over here. and here you can see we have the user option over here if we click user here you can see name email everything is empty because there is no data in the user table okay let me just show you let's just insert data in the user table so let's see what here user on email will be user on at the top gmail.com let's just click go over here and if you now just refresh over here here you can see we can see that user data over here So we can also see this or we can even delete it from here as well.

And you can even create new roles and give a certain permission to a certain user because obviously you don't want if the user to have access to this helper function. So this is all I hope you like this tutorial. If you have any question you can let me know in the comment section. And if you want me to make a specific type of video then you can also let me know in the comment section as well.

And if you want to learn about more admin panel like this, please do subscribe to my channel. Thank you. this that you can check out the video in the skin. Thanks again for watching.

I hope you subscribe this channel and I hope to see in the future tutorials.