Laravel 9 with Voyager - The Missing Laravel Admin
Summary
TLDREn este video, el creador muestra cómo instalar Laravel 9, la versión más reciente de este framework popular, junto con el paquete Voyager, que añade una interfaz de administración y control de roles y permisos. Se detalla el proceso de configuración, desde la creación del proyecto hasta la instalación de Voyager con datos de ejemplo, y se exploran algunas de sus características, como el generador de menús y el administrador de base de datos, resaltando su facilidad de uso y la mejora en la seguridad al restringir el acceso directo al servidor de base de datos.
Takeaways
- 😀 Se muestra cómo instalar Laravel 9, la última versión lanzada hace algunas semanas.
- 🛠 El objetivo principal es configurar un nuevo proyecto de Laravel 9 y utilizar el paquete Voyager para la administración de paneles y roles de usuario.
- 📋 Se mencionan las características principales de Voyager, incluyendo funcionalidades CRUD, media manager, generador de menús, y editor de bases de datos.
- 💻 Se utiliza Composer para crear el proyecto Laravel y se nombra el proyecto 'web_laravel_voyager'.
- 🌐 Se establece un servidor de desarrollo utilizando Laravel's PHP Artisan y se configura una base de datos MySQL con phpMyAdmin.
- 🔑 Se actualiza el archivo .env con las configuraciones de la base de datos y se genera una clave de aplicación.
- 🔄 Se verifica la versión de Laravel y se procede a instalar Voyager siguiendo la documentación de GitHub.
- 📝 Se detalla el proceso de instalación de Voyager, incluyendo la ejecución de migraciones y la inserción de datos ficticios para pruebas.
- 🚀 Después de la instalación, se verifica que Voyager está accesible a través de la URL '/admin' y se inicia sesión con datos de prueba.
- 📊 Se exploran las funcionalidades de Voyager, como el generador de menús, el editor de bases de datos y el administrador de recursos.
- 🔧 Se destaca cómo Voyager simplifica tareas comunes en Laravel, como la creación de BREAD (Browse, Read, Edit, Add, Delete) y el acceso a comandos Artisan.
Q & A
¿Qué versión de Laravel se instala en el video?
-Se instala Laravel versión 9, que es la última versión lanzada en ese momento.
¿Cuál es el propósito principal de crear este video?
-El propósito principal es mostrar cómo instalar Laravel versión 9 y configurar un proyecto nuevo, además de integrar el paquete Voyager, que proporciona un panel de administración y roles de usuario.
¿Qué características principales incluye el paquete Voyager?
-Voyager ofrece características como gestor de medios, constructor de menús, administrador de bases de datos, creador de Bread y configuración, entre otras.
¿Cómo se verifica la compatibilidad entre Laravel versión 9 y Voyager?
-Se verifica la compatibilidad instalando Voyager a través de Composer y ejecutando la migración de bases de datos y seeders con datos de prueba para asegurarse de que todo funcione correctamente.
¿Qué herramienta se utiliza para el servidor de desarrollo en el proyecto de Laravel?
-Se utiliza el servidor de desarrollo de Laravel's PHP Artisan, conocido como Laravel Valet.
¿Qué tipo de base de datos se utiliza en el proyecto?
-Se utiliza MySQL como sistema de base de datos, junto con phpMyAdmin como herramienta de cliente web.
¿Cómo se configura el entorno de base de datos en el proyecto de Laravel?
-Se configura editando el archivo .env con los detalles de conexión a la base de datos, como el host, puerto, nombre de la base de datos, usuario y contraseña.
¿Cómo se puede verificar que la instalación de Laravel versión 9 fue exitosa?
-Se verifica la instalación ejecutando el comando 'php artisan --version' en la terminal, que debe mostrar la versión 9.8.1 de Laravel.
¿Cómo se instala Voyager en el proyecto de Laravel?
-Se instala Voyager a través de Composer utilizando el comando 'composer require tcg/voyager' y luego se ejecuta 'php artisan voyager:install' para instalarlo con datos de prueba.
¿Dónde se puede acceder al panel de administración de Voyager?
-Se puede acceder al panel de administración de Voyager en la URL del proyecto, añadiendo '/admin' al final de la dirección.
¿Qué se puede hacer con el constructor de menús de Voyager?
-El constructor de menús permite crear menús dinámicos con características de arrastrar y soltar, y también permite restringir la visibilidad del menú para diferentes roles de usuario.
Outlines
😀 Instalación de Laravel 9 y Voyager
El primer párrafo presenta un tutorial sobre cómo instalar la versión 9 de Laravel, la más reciente en ese momento. El objetivo es configurar un nuevo proyecto de Laravel y utilizar el paquete Voyager para crear un panel de administración con funciones de usuario y permisos. Se menciona la necesidad de verificar la compatibilidad entre Laravel 9 y Voyager, y se inicia el proceso de instalación a través de Composer, así como la configuración de un servidor de desarrollo y una base de datos MySQL.
🔧 Configuración de la Base de Datos y Instalación de Voyager
En el segundo párrafo, se continúa con la configuración del proyecto, incluyendo la conexión a una base de datos MySQL y la personalización de las credenciales de acceso. Se actualiza la información de la base de datos en el archivo de configuración y se procede a instalar Voyager a través de Composer. Se menciona la instalación con datos de prueba para tener usuarios de ejemplo y se verifica la correcta instalación al iniciar el servidor de desarrollo y acceder a la URL correspondiente.
🛠️ Características y Funcionalidades de Voyager
El tercer párrafo se enfoca en las características principales de Voyager, como el creador de menús, el administrador de bases de datos y la funcionalidad BREAD (Browse, Read, Edit, Add, Delete). Se explora cómo Voyager simplifica la administración de la base de datos y la creación de interfaces de usuario dinámicas, permitiendo restringir la visibilidad del menú y la manipulación de datos según los roles de usuario. También se menciona la sección de herramientas, donde se pueden ejecutar comandos Artisan y acceder a recursos y registros.
🔄 Pruebas y Verificación de la Integración de Voyager con Laravel 9
El último párrafo resume la verificación de que Voyager funciona correctamente con Laravel 9, mostrando la interfaz de administración y las funcionalidades disponibles. Se menciona la intención de profundizar en las características de Voyager en futuras videos y se concluye el tutorial, agradeciendo a los espectadores por su atención.
Mindmap
Keywords
💡Laravel
💡Composer
💡Voyager
💡PHP artisan
💡.env archivo
💡Base de datos
💡Migraciones
💡Seeds
💡BREAD
💡Menu Builder
Highlights
Tutorial on installing Laravel version 9.
Introduction of Voyager package for admin panel and user roles management.
Features of Voyager including media manager, menu builder, and database manager.
Setting up a fresh Laravel 9 project with compatibility check for Voyager.
Using composer to create a new Laravel project named 'web_laravel_voyager'.
Explanation of using Laravel's PHP artisan development server.
Requirement of a database instance and use of MySQL DB with phpMyAdmin.
Creating a database for the Laravel project using phpMyAdmin.
Confirmation of Laravel version 9.8.1 using 'php artisan' command.
Instructions on installing Voyager via composer for Laravel.
Importance of setting up the Laravel development server before Voyager installation.
Updating .env file with database credentials for Laravel project.
Voyager installation with dummy data for initial user access.
Verification of Voyager's compatibility with Laravel 9 by accessing the admin panel.
Demonstration of Voyager's menu builder with drag and drop functionality.
Explanation of how to use Voyager for database access and BREAD operations.
Use of Voyager's BREAD for creating, reading, editing, and deleting data.
Access to artisan commands and resources through Voyager's Compass.
Introduction to Voyager's logs for tracking user interactions and actions.
Conclusion on the successful setup and compatibility of Voyager with Laravel 9.
Transcripts
hey guys hope you guys are doing well so
today i'm going to show you how to
install laravel version 9 which is the
latest laravel version that they
released a couple of weeks ago
and
i have mainly two intentions uh of
creating this video
one is to set up a fresh laravel 9
project and along with there is an
awesome
package called voyager
which gives the admin panel and
our user roles permissions level uh
ability to learn your larger project so
if i scroll down little bit it shows
what are the features main features
it comes with so in their home page it
shows they have great functionality
which is you know we have crowd
functionality for our normal um
applications um software web
applications create read update delete
functionality so top of that they have
created great functionality browse read
edit add and delete functionality so
let's explore it little bit more if we
go into this section features
um they have given an overview about
their main features so they have media
manager menu builder database manager
red card builder which was the one we
referring to earlier and settings and
compass anyway so first let's try to set
up a laravel version 9 project
because uh my intention is to check the
compatibility with the laravel version 9
with voyager uh because sometimes with
some laravel versions there were
incompatibility
with voyager
hopefully
this
laravel version i should be working with
voyager stable version let's give a try
so i'm getting my command
command prompt and i'm going to install
laravel with composer composer create
project
larval
i'm giving some meaningful name web
laravel
voyager
let's try let's see
yeah it's creating the project in the
meantime i will show my
um new environment for
uh the project
basically i'm i'm going to use uh
laravel's php artisan the div server
development server for this so the
server environment is fine uh but i need
a database instance and i will need a
database um
client tool so i'm going to use mysql db
along with phpmyadmin which is the
web-based uh which is a web-based
db client tool it's very simple and easy
to set up so i'm using sam software
for that so i'm going to
access the
ph
okay i don't need that google page so
i'm going to access the
php my admin page so localhost and here
phpmyadmin you can see there's a apache
page there so the databases
okay i will need to create a database
let's try first laravel line so it's
almost done now it's setting up what all
that files
yeah
cool so i will need to navigate into the
project folder cd app
okay let's try whether we have got the
correct global version
hp artisan would do that for us so if i
scroll up
it should show the laravel version yeah
laravel framework
9.8.1 with major 9 version 9 my
innovation 8 and patch release one cool
okay so
now we will try to install the voyager
we can do that through
get the documentation setup right
through github which is easier
yeah okay it's there
uh prior to that i will be ready to
bring my project into
my vs code so
i'm going to
okay
yeah this one
so let's explore a little bit the full
files and folder structure
okay it's cool it comes with dot env
file in laravel version 9 because if i'm
not wrong in laravel version 8 and
couple of earlier versions
they give us a dot env dot example file
which will be needed to create our dot
env file by ourselves by copying it and
removing it the dot example
extension it's not a big deal anyway but
this is cool um they give straightaway
dot dmv file with
and
app key is also generated at the project
setup
stage yeah i think that's how it
normally works not sure sometimes we
will be to create the
app key php artisan key generate this
command sometimes anyway
so
it's cool um
so let's give
our adb configurations here db
connection mysql that's fine db hosts
one two seven zero zero one local lost
okay five three six
the date i think yeah data this username
is fine in my case the same set of the
dummy username and password so just only
just one thing i need to update
which is the tp credentials so
i will create a database laravel
underscore
db
watch already discovery tv
i think that's a more meaningful name
okay it's created yeah cool so i'm going
to copy the database name and i'm going
to paste it over here
sorry this is space
okay it's saved
okay let's back to the
documentation guide
okay first step is to install voyager
through composer so i'm copying the
command
and
okay
sorry what first let's try to set up
laravel
um deep server without prior to
installing voyager i think that's a good
practice if there any issues with our
laravel version 9 it should be
uh
showing at that point because we cannot
then isolate the whether the error is
from laravel version 9 over from the
voyager
so hp artisan
so
cool it's now our div server is up on
this port
means
localhost
port 8000
yeah cool it shows laravel version 9.
yeah
okay so
let's go back to setting up voucher
so i will need to stop the tv server at
this point and paste the command over
here
yep using version 1.5
it's installing the dependency packages
doctrine
um
laravel ui
okay
it's almost done now generating auto
load files optimizing our dollar files
okay cool it's done
so i'm bringing up my div server again
and i should be able to refresh and
yeah it's working
so the database credentials are set up
already
and this one is the base urf our project
since our project is um
so under localhost port 8000 we need to
update that
because
laravel
um
comes without that port they have just
been the global last
we need to remove that
forward slash probably
yeah
so the next point step is to install
voyager
um this is how a vendor package
installing in
laravel
so we will
install with some dummy data because i
will be needed some login uh i use a
dummy user and admin user in the latest
step so i will go ahead with dummy data
and i will install the voice with dummy
data
stop the server again
php artisan version call and install it
okay cool it's migrating all the
migration files
to create the
database tables
and see the
seeded database
with
some data
okay so if i go to the
migration files the database migrations
these are these are the files
are created by laravel itself version
nine um
all these
data based tables some dummy tables post
create post grade pages
likewise
and
voyager
uh it has
migration files
by version itself so voyager resides in
vendor
tcg
under this folder you can see tcg slash
so the migration files are coming from
this they have more than 10 to 12
migration files
so
basically two sets
of migration files
both sets are created already so we can
verify that go into our database and
refresh it
yeah cool all the database
uh sorry all the tables
have been created so we can
proceed further more
so now voyager should be accessible
under this url forward slash admin let's
give a try
oh my bad i think i have stopped the new
server yeah
okay now it should be working yeah cool
so vijay is up under
forward slash admin so it's redirecting
to the
login um
root
uh router uh once we hit the admin path
yeah
okay that's fine so
i'm getting the dummy username and
password from voicer guide
this login
should be
cool so this is the dashboard
so that we have now verified la voja is
working with laravel version 9 without
an issue so far
yeah so the under tools section i would
like to show you guys these interesting
features menu builder which is
which are the same features
um mentioned here menu builder
so which is a dynamic menu builder we
can um it has a drag and drop feature we
can drag menu items like this here and
there this is the admin menu um which
means this menu for the voyager as the
same way we can uh we can add a new menu
item and not no that's not the
interesting thing we can add a new menu
and we can add our own menu items sub
menu items and the stuff then this menu
uh name
we can call it in our blade uh files in
laravel that we can render the menu in
appropriate areas
um not only rendering the menu on blade
files but also it allows us to restrict
the
menu visibility for several
user roles and permissions in in which
you can see users we can add users
and
we can add roles so
we can create uh
role groups like administrator likewise
and we can
give
access levels you know privilege levels
so in that case we can restrict uh
showing
the menu
for
unnecessary users as an example if there
is an admin user and there is a
moderator user so the moderator will be
seeing a different menu while admin
administrator will be seeing another
menu yeah so that's cool so simply we
can create the menu here and the menu
variable
we can render in the blade file site in
laravel
so if i go to menu builder again so it
shows you cannot put a menu anywhere
your site by calling
menu is the helper method is given by
voyager itself and calling the name is
the menu name that we are giving in this
case it's admin so if we call menu
um brackets
uh and
if we pass
admin as a string then it will be
rendering this same menu anywhere in the
um
blade file yeah that's cool
and apart from that it's a database we
can access the database through the
voyager because um
rather giving direct access to database
through command line tools which is a
very
uh not a secure secure secure practice
we can give like this then we can
restrict users accessing the database
uh so in this database uh page itself we
can create uh
add bread that means as um as we know
now
this one browse read edit and delete
feature so we can we can check the
browse bread because this categories
table already has a great
functionality created if we go to browse
bread we can check
browse means this one so it lists all
the items category one category two
these are the items and grid means this
one view
we can give this we have a specific uh
item
and
edit
b r e e for edit we can edit this
so these are already created by the
logic and everything by the laravel uh
voyager sorry the voyager itself so
simply we can use this stuff in our
models everywhere
um so it's very easier and
less time consuming
yeah so and if i go further more into
the
bread
i'm skipping that compass compass
section for a while
so the bread is the the once you created
bread for
features so it's it's uh listed up here
like this all the bread function and
these are listing here
yeah so we can add bread to this table
and we can delete everything can be done
here and compass is kind of a
um
kappa section will help provide your
resources so yeah this is giving some
stuff so
there are a couple of things we can we
can uh
set up commands
through here we can get
we can access our
artisan commands from voyager easily we
can run them through here
and at the same time we can in the
resources section we have some fonts you
know font awesome um kind of fonts are
there they have
created font stuff to styling stuff we
can copy this one and we can use in uh
our blade files to nicely render to
nicely render these icons because it can
be easily identified by the identifier
by then later
so in the logs
you can check what are the logs we have
if i try to access some command
php artisan
okay i will try to run php artisan some
test
i think it should comes with some dummy
unit and feature testings little
you will give a try that
test
feature
unit
okay that's what's it
okay these that's operated by voyager
that's cool yeah
earlier they were
not
creating these text tests as i remember
yeah that's cool
so we'll try one
one test
hp artisan test
ttt
is there any test
related to test cases
try test
yeah
additional arguments we can give
arguments if you need no
we'll try to give you
undefined array key
oh that's cool so
there's some issue with test cases i
mean um we haven't properly set up our
test
so that's why it's showing
this error
but which means anyway through voyager
itself we can
run our
artisan commands
so simply without giving accessing
without giving the access to artisan
tool and database
command line to only tools we can simply
give some users to access only to
voyager which is see we can then audit
in some cases we can audit user
interactions with the application
uh
by through a simple logic then we can
track what are the actions that they
perform for
specific thing then if there is
something if something goes wrong we can
identify which user they did that and we
can um get further actions accordingly
yeah so yeah this is a quick overview of
voyager especially not viral version 9
just wanted to check whether it is
compatible with laravel version 9. yeah
it seems everything works fine so far so
cool so in a later video i will
be trying to
dig into virtue and its features
furthermore okay so for um let's meet
another video later okay thanks for
watching and see you bye
تصفح المزيد من مقاطع الفيديو ذات الصلة
Instalación de MySQL 🐬 para iniciar con Bases De Datos 🗃
cómo CREAR NOTAS en NOTION con SIRI 🤖 (fácil) con Atajos [2024]
Curso de Oracle Apex desde cero para principiantes | INSTALACION APEX 5.0 (video 3)
Cómo instalar y configurar SQL Server 2019
Cómo Descargar e Instalar MySQL y Workbench Fácil 2024 - Windows 10/11
🔵 Cómo INSTALAR MySQL WORKBENCH en WINDOWS | Por Completo y Muy Fácil 📦✅
5.0 / 5 (0 votes)