Questions tagged as 'laravel'

2
answers

LARAVEL 5.2 - Integrity constraint violation: 1452 Can not add or update to child row: - Problem relating tables

I'm trying to fill some tables with the faker library, so far I have not had any problems, since they were mini-projects and the tables were not related, but now, I'm starting with relations in laravel and I get an error that does not I can solv...
asked by 18.05.2016 / 20:02
1
answer

Bring categories with multiple levels

I have in database a table of categories of up to three levels. In this I keep their subcategories recursively. The structure is this: categoria ------------------ (pk) | id | nombre | slug | icono (fk) | padre <--...
asked by 02.08.2018 / 00:56
0
answers

Select query problem in Laravel

I am creating a form to register users, it works with normal fields, but if I want to add a select the form says that it does not recognize the variable.    "Undefined variable: user_types (View:   C: \ laragon \ www \ crudgobernaciont...
asked by 05.10.2018 / 21:58
2
answers

Obtain data from a user in Laravel

They ask me to show the data of a user (using their id), I have created the table and the model with artisan, I have filled two objects in the phpmyadmin database, in the model I have Put this: <?php namespace App; use Illuminate\Databa...
asked by 08.07.2018 / 22:16
1
answer

Query with eloquent amount and limit to obtain

Hello, someone could help me with an eloquent query. User::with(['post','Y aun tengo más relaciones. ..']) ->where('nick',$nick)->first(); This way I get the information of a user X and I see the posts. but I need only show the las...
asked by 30.10.2018 / 02:58
1
answer

Authorize SPA client using client credential grant token and personal access token - Laravel Passport

First I will put them in context. I am developing a Rest API using laravel and as authorization method oauth2 using Laravel Passport implementation. On the other hand I am developing a Javascript client (Single Page Application or SPA) tha...
asked by 07.05.2018 / 23:07
2
answers

Search Result in Laravel

Doing a search in Laravel, it gives me the search well in terms of name but not in ID. That is to say. This is the list of objects <div class="panel-body-exercises"> <h1 class="hidden">List of Exercise </h1>...
asked by 13.04.2018 / 23:25
1
answer

Security deploy API Laravel

I have an app made in Laravel only to consume in REST but how do I do it so that there are not public files and sensitive routes like / storage or composer.json until .env? What good practices do you recommend, if .htaccess is a good idea or not...
asked by 13.04.2018 / 00:36
1
answer

How to generate a proper join query that brings me data from two tables?

I am presenting inconveniences to show the data I require. I currently have two tables that are related as follows: Peliculas imagenes_peliculas -id <--> -pelicula_id -nombre -urlimg -descripcion by means of id I have tha...
asked by 12.04.2018 / 22:56
0
answers

Laravel - Get BLOB in response Json or other

I'm getting information specific to a id , the detail is what comes with columns blob My answer when trying My controller: if(ctype_digit($id) == false) return redirect('/')->with('error', 'Id invalido'); $conten...
asked by 12.12.2018 / 00:31