I have a question since I start to investigate and I do not give even with the answer. I want that in my view that has several input the text that is in my database is loaded and that is loaded in a div or something like that the previsualization of an image that is in my database so that I can see what there is to so modify, so far I only have a view and a driver empty since I do not know where I could start (as you can see I've only lasted 3 days with laravel haha but good to the blows is that one learns xD)
my view (home.blade.php)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.bundle.min.js" integrity="sha384-feJI7QwhOS+hwpX2zkaeJQjeiwlhOP+SdQDqhgvvo1DsjtiSQByFdThsxO669S2D" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css?family=Inconsolata" rel="stylesheet">
<style type="text/css">
html {
height: 100%;
width: 100%;
}
body {
background-color: #f6fafa;
height: 100%;
width: 100%;
margin-top: 0px;
font-family: 'Inconsolata', monospace;
}
#cont {
width: 100%;
height: 100%;
background-color: #0099FF;
}
#side {
background: #0c5460;
}
#side2 {
background: rgb(255, 255, 255);
}
#btn-cus {
border-radius: 0.5rem;
}
.col-2 {
padding-right: 1px;
}
</style>
</head>
<body>
<div class="row" id="cont">
<div class="col-2" id="side">
<div class="container">
<div class="row justify-content-center">
<img src="./img/logo.png" style="width:5rem; height:5rem; margin-top: 2.5rem; margin-bottom: 1.5rem;"/>
</div>
<div class="row justify-content-center" style="margin-bottom: 3rem;">
<button type="button" class="btn btn-danger">CERRAR SESIÓN</button>
</div>
<div class="row justify-content-center">
<button type="button" ID="btn-cus" class="btn btn-primary"; style="width: 93%; margin-bottom: 0.3rem; padding: 10px;">PAGINA/SECCIONES</button>
</div>
<div class="row justify-content-center">
<button type="button" ID="btn-cus" class="btn btn-primary"; style="width: 93%; margin-bottom: 0.3rem; padding: 10px;">AGREGAR TOURS</button>
</div>
<div class="row justify-content-center">
<button type="button" ID="btn-cus" class="btn btn-primary"; style="width: 93%; margin-bottom: 0.3rem; padding: 10px;">LOGIN/PASS</button>
</div>
</div>
</div>
<div class="col-10" id="side2">
<div class="container" style="background-color: #e3e6e9; margin-top: 1rem; height:95%; padding: 2rem 1rem 1rem 1rem;">
<div class="container" style="background-color: #f0f3f5; height: 100%; border-radius: 5px 5px 0px 0px;">
<!-- TITLO -->
<div class="row justify-content-between" style="box-shadow: 0px 0px 10px 1px rgba(0, 0, 0, 0.47);
border-radius: 5px;
background: #f0f3f5;
padding: 0.7rem 0.2rem 0.2rem 0.2rem;">
<div class="col-6">
<h4 style="color: #0b4650;"><strong>HOME/EDIT</strong></h4>
</div>
<div class="col-6" style="text-align: right; padding-right: 3rem;">
<p style="color:gray;">ÚLTIMA EDICIÓN 24/02/2018</p>
</div>
</div>
<!-- ___________________FORMULARIO___________________ -->
<form method="POST" action="{{ route('home') }}">
<!-- BOTONES GUARDAR / CERRAR -->
<div class="row" style=" text-align: right;
margin-top: 1rem;
margin-bottom: 1rem;">
<div class="col-12">
<button type="button" class="btn" style="background: #065e6e; color: white; width: 7rem;">CERRAR</button>
<button type="SUBMIT" class="btn" style="background: #00a751; color: white; width: 7rem;">ACTUALIZAR</button>
</div>
</div>
<!-- TITULOS -->
<div class="row">
<div class="col-6" style="padding-left: 3px; margin-bottom: 1rem;">
<input type="text" placeholder="PRIVATE EXCURSSIONS IN SANTIAGO DE CHILE" style=" width: 100%; padding: 0.3rem; background: #e3e6e9;
border: solid 1px #8181825c;" text="PRIVATE ESCRUSSION IN SANTIAGO DE CHILE">
</div>
<div class="col-6" style="padding-right: 3px; margin-bottom: 1rem;">
<input type="text" placeholder="Titulo Español" style="width: 100%; padding: 0.3rem; background: #e3e6e9;
border: solid 1px #8181825c;">
</div>
</div>
<!-- DESCRIPCION -->
<div class="row">
<div class="col-6" style="padding-left: 3px; margin-bottom: 1rem;">
<textarea name="message" rows="30" cols="80" style=" width: 100%; padding: 0.8rem; height: 10rem; background: #e3e6e9; border: solid 1px #8181825c;">The primary objective of Pikun Mapu is to provide innovative and unique travel experiens fot the best value showcasing the most spectacular places, attractions and activities in Santiago de Chile</textarea>
</div>
<div class="col-6" style="padding-right: 3px; margin-bottom: 1rem;">
<textarea name="message" rows="30" cols="80" style=" width: 100%; padding: 0.8rem; height: 10rem; background: #e3e6e9; border: solid 1px #8181825c;">Texto Español</textarea>
</div>
</div>
<hr/>
<!-- CARGAR IMAGENES -->
<div class="row">
<div class="col-6">
<h4>IMÁGENES DESKTOP</h4>
</div>
<div class="col-6">
<h4>IMÁGENES MÓVIL</h4>
</div>
</div>
<div class="row">
<div class="col-6">
<input type="file" id="files" name="files[]" />
<br />
<div style="width: 5rem; height: 5rem;">
<output id="list"></output>
</div>
</div>
<div class="col-6">
<input type="file" id="files" name="files[]" />
<br />
<output id="list"></output>
</div>
</div>
</div>
</div>
<script>
function archivo(evt) {
var files = evt.target.files; // FileList object
// Obtenemos la imagen del campo "file".
for (var i = 0, f; f = files[i]; i++) {
//Solo admitimos imágenes.
if (!f.type.match('image.*')) {
continue;
}
var reader = new FileReader();
reader.onload = (function(theFile) {
return function(e) {
// Insertamos la imagen
document.getElementById("list").innerHTML = ['<img class="thumb" src="', e.target.result,'" title="', escape(theFile.name), '"/>'].join('');
};
})(f);
reader.readAsDataURL(f);
}
}
document.getElementById('files').addEventListener('change', archivo, false);
</script>
</body>
</html>
The controller empties with its index, store, etc. etc methods and the route declares it like this: Route :: get ('home', 'HomeController @ index') - > name ('home');
I also have my model that is the next one that in it will introduce all the texts of titles, description and images in my database if it is not the best all like that but good: / and of course, then I will metere all the css in the file and that, but my concern and objective is to do what I previously told you, if you have alduna documentation or can advise me welcome, be it: D
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateSectionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sections', function (Blueprint $table) {
$table->increments('id');
$table->string('titu_1_ing');
$table->string('titu_1_esp');
$table->string('desc_1_ing');
$table->string('desc_1_esp');
$table->string('fond_1_dsk');
$table->string('fond_1_mbl');
$table->string('titu_2_ing');
$table->string('titu_2_esp');
$table->string('desc_2_ing');
$table->string('desc_2_esp');
$table->string('fond_2_dsk');
$table->string('fond_2_mbl');
$table->string('titu_3_ing');
$table->string('titu_3_esp');
$table->string('desc_3_ing');
$table->string('desc_3_esp');
$table->string('fond_3_dsk');
$table->string('fond_3_mbl');
$table->string('titu_4_ing');
$table->string('titu_4_esp');
$table->string('desc_4_ing');
$table->string('desc_4_esp');
$table->string('fond_4_dsk');
$table->string('fond_4_mbl');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sections');
}
}