{"id":2748,"date":"2020-06-14T12:28:03","date_gmt":"2020-06-14T17:28:03","guid":{"rendered":"http:\/\/linuxitos.com\/main\/?p=2748"},"modified":"2020-06-16T18:30:07","modified_gmt":"2020-06-16T23:30:07","slug":"parte-2-laravel-7-xampp-fedora-32","status":"publish","type":"post","link":"https:\/\/linuxitos.com\/main\/parte-2-laravel-7-xampp-fedora-32\/","title":{"rendered":"Parte 2: Laravel 7, XAMPP | Fedora 32"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/fc_xampp_laravel-1-1024x475.png\" alt=\"\" class=\"wp-image-2749\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/fc_xampp_laravel-1-1024x475.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/fc_xampp_laravel-1-300x139.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/fc_xampp_laravel-1-768x357.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/fc_xampp_laravel-1-1536x713.png 1536w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/fc_xampp_laravel-1-2048x951.png 2048w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/fc_xampp_laravel-1-1600x743.png 1600w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>Cada uno puede hacerlo de la manera m\u00e1s conveniente posible, recordar que \u00e9stos son ejemplos b\u00e1sicos, se puede tomar el c\u00f3digo y mejorarlo, est\u00e1n en todo su derecho hacerlo. Tomar en cuenta la seguridad, las mejores pr\u00e1cticas, etc.<\/p><\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\">Inicio<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Siguiendo con \u00e9ste tutorial, en esta parte 2, mostrar\u00e9 c\u00f3mo configurar la base de datos, crear las funciones de login, y crear unas vistas adicionales utilizando bootstrap 4.5.0<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Configurar base de datos<\/li><li>Configurar funci\u00f3n login<\/li><li>Funcionamiento<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Configurar base de datos<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previo a configurar la base de datos, es necesario abrir en el navegador phpmyadmin, y crear una base de datos vac\u00eda, s\u00f3lo la base de datos.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-20-21-1024x560.png\" alt=\"\" class=\"wp-image-2760\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-20-21-1024x560.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-20-21-300x164.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-20-21-768x420.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-20-21.png 1508w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Yo recomiendo crear un usuario espec\u00edfico para acceder s\u00f3lo a la base de datos laravel-crud-four, con los permisos esenciales, as\u00ed como un acceso local o remoto dependiendo de su caso, \u00e9sto como una buena pr\u00e1ctica, pero tambi\u00e9n pueden utilizar el usuario root:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-24-30-1024x560.png\" alt=\"\" class=\"wp-image-2761\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-24-30-1024x560.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-24-30-300x164.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-24-30-768x420.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-24-30.png 1508w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Configurar los accesos, como usuario, contrase\u00f1a, puertos, etc.<\/p>\n\n\n\n<pre style=\"background: rgb(245, 245, 245); border-radius: 4px; border: 1px solid rgb(204, 204, 204); box-shadow: rgb(204, 204, 204) 0px 0px 3px; box-sizing: border-box; color: #262626; font-family: &quot;Courier 10 Pitch&quot;, Courier, monospace; font-size: 1rem; font-stretch: normal; font-style: inherit; font-weight: inherit; line-height: 1.6; margin-bottom: 10px; max-width: 100%; outline: 0px; overflow: auto; padding: 9.5px; tab-size: 4; text-shadow: rgb(255, 255, 255) 0px 1px 0px; vertical-align: baseline; word-break: break-all; word-wrap: break-word;\">DB_CONNECTION=mysql\nDB_HOST=127.0.0.1\nDB_PORT=3306\nDB_DATABASE=laravel-crud-four\nDB_USERNAME=laravel\nDB_PASSWORD=\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Crear funci\u00f3n de login<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Lo que hace \u00e9sta funci\u00f3n es permitir que el usuario se pueda registrar, iniciar sesi\u00f3n, recuperar su usuario, etc.<\/p>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">composer require laravel\/ui --dev<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"306\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-31-1024x306.png\" alt=\"\" class=\"wp-image-2752\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-31-1024x306.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-31-300x90.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-31-768x230.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-31.png 1147w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">php artisan ui bootstrap --auth<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"306\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-53-1024x306.png\" alt=\"\" class=\"wp-image-2753\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-53-1024x306.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-53-300x90.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-53-768x230.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-46-53.png 1147w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">npm install &amp;&amp; npm run dev<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"306\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-47-49-1024x306.png\" alt=\"\" class=\"wp-image-2754\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-47-49-1024x306.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-47-49-300x90.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-47-49-768x230.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-11-47-49.png 1147w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Los comandos anteriores, crear\u00e1n el controlador HomeController y las vistas de auth para inicio y registro de sesi\u00f3n, pero conforme se conozca laravel, se podr\u00e1 modificar a la necesidad.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Si entran a la ruta resources\/views\/ habr\u00e1 un carpeta de nombre auth, donde est\u00e1n las vistas de login, registro, etc., esas vistas, podr\u00e1n modificarlo en caso de ser necesario.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Migrate<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ejecutar el comando para guardar los cambios de las tablas a la base de datos, obviamente, es necesario previamente crear la base de datos, y desde laravel crear las tablas que se requieran.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Al usar xampp es necesario utilizar el comando \/opt\/lampp\/bin\/php artisan migrate ya que como no se usa como apache instalado en todo el SO, no encontrar\u00e1 correctamente el funcionamiento del comando php.<\/p>\n\n\n\n<pre style=\"background: rgb(54, 63, 72); border-radius: 6px; border: 0px; box-sizing: border-box; color: white; font-family: menlo, monaco, monospace; font-style: inherit; font-weight: inherit; line-height: 15.68px; margin-bottom: 1.1em; max-width: 100%; outline: 0px; overflow: auto; padding: 13.125px 16.4062px; vertical-align: baseline; white-space: pre-wrap; word-wrap: break-word;\">\/opt\/lampp\/bin\/php artisan migrate<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"306\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-10-26-1024x306.png\" alt=\"\" class=\"wp-image-2755\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-10-26-1024x306.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-10-26-300x90.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-10-26-768x230.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-10-26.png 1147w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">En la interfaz, se podr\u00e1 visualizar en la parte superior derecha, los botones de inicio de sesi\u00f3n y registro<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-51-1024x560.png\" alt=\"\" class=\"wp-image-2757\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-51-1024x560.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-51-300x164.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-51-768x420.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-51.png 1508w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Si se da clic en ambos para probar la funcionalidad, dirigir a las siguientes secciones:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-57-1024x560.png\" alt=\"\" class=\"wp-image-2758\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-57-1024x560.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-57-300x164.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-57-768x420.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-13-57.png 1508w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"560\" src=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-14-01-1024x560.png\" alt=\"\" class=\"wp-image-2759\" srcset=\"https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-14-01-1024x560.png 1024w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-14-01-300x164.png 300w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-14-01-768x420.png 768w, https:\/\/linuxitos.com\/main\/wp-content\/uploads\/2020\/06\/Screenshot-from-2020-06-14-12-14-01.png 1508w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Los archivos de \u00e9sta tutorial los estar\u00e9 subiendo al siguiente repositorio de github:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/jesusferm\/laravel-crud-four\">https:\/\/github.com\/jesusferm\/laravel-crud-four<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Hasta ahora no hemos modificado nada de las vistas, rutas o controladores, s\u00f3lo hemos usado las funciones propias de laravel, en la siguiente entrega mostrar\u00e1 c\u00f3mo personalizar e incluir bootstrap, para personalizar las vistas y rutas.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cada uno puede hacerlo de la manera m\u00e1s conveniente posible, recordar que \u00e9stos son ejemplos b\u00e1sicos, se puede tomar el c\u00f3digo y mejorarlo, est\u00e1n en todo su derecho hacerlo. Tomar en cuenta la seguridad, las mejores pr\u00e1cticas, etc. Inicio Siguiendo con \u00e9ste tutorial, en esta parte 2, mostrar\u00e9 c\u00f3mo configurar la base de datos, crear [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1540],"tags":[1561,1638,1587],"class_list":["post-2748","post","type-post","status-publish","format-standard","hentry","category-develepmet","tag-fedora","tag-laravel","tag-xampp"],"_links":{"self":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/2748","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/comments?post=2748"}],"version-history":[{"count":5,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/2748\/revisions"}],"predecessor-version":[{"id":2798,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/posts\/2748\/revisions\/2798"}],"wp:attachment":[{"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/media?parent=2748"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/categories?post=2748"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxitos.com\/main\/wp-json\/wp\/v2\/tags?post=2748"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}