Questions tagged as 'laravel-5'

1
answer

Update fields of several tables in Laravel

I have a question, how can I make this query in laravel using Eloquent ? UPDATE Tabla1, Tabla2, Tabla SET Tabla1.estado = 1, Tabla2.estado = 1, Tabla3.estado = 1, WHERE Tabla1.estado = 0 or Tabla2.estado = 0 or Tabla3.estado...
asked by 27.04.2017 / 14:42
1
answer

Laravel (errno: 150 "Foreign key constraint is incorrectly formed")

I do not know what happens. Schema::create('option_question', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('question_id'); $table->unsignedInteger('option_id'); $table->timestamps(...
asked by 28.06.2017 / 17:58
1
answer

problems with query eloquen laravel 5.5

I tried to translate this query to eloquent , but it still does not work for me, I just want to see it based on a field with no null values. select * from usuarios where asignacion is not null; How can I do it?     
asked by 01.12.2018 / 23:38
1
answer

Collect the IDs for JavaScript error

Tegno is formulated in JavaScript: function formula() { var cantidad = document.form1.cantidad.value; var precio_unitario = document.form1.precio_unitario.value; var total = document.form1.total.value; try{ cantidad = (isNaN(parseInt(cant...
asked by 19.09.2017 / 12:39
2
answers

Can you instantiate a class from another project?

I would like to know if it is possible to make the call of a function that is in a class of another project. This is the structure of both projects: . ├── Proyecto 1 (PHP) │   └── CarpetaDeClases │   └── ClaseALlamar │ └── Proyecto 2 (L...
asked by 22.09.2016 / 18:56
2
answers

how to make redirects in laravel

Well, first of all thanks to the users of this community for helping me repeatedly with my doubts in PHP, THANKS! Today my question is something totally new for me, I am new to laravel and I have a project created in pure PHP working, I want to...
asked by 13.06.2018 / 05:49
1
answer

Access the methods of a table and its variables

You see, I have 3 tables: plants, User and comments. The comment table has foreign keys that point to the user and the plant. I have created a view in which I can see what comments there are on each floor: @extends('layouts.app') @section('con...
asked by 12.02.2018 / 18:19
1
answer

Problem when passing data from a Laravel driver to a view with Vue

I'm passing some data from a controller in the index method: public function index() { $variable = Modelo::orderBy('id', 'DESC')->get(); return view('vista', compact('variable')); } and I am receiving them in this view: <t...
asked by 13.02.2018 / 23:59
2
answers

Error because the User table already "exists"

I'm encountering a strange error by which when I try to do the migration of the table, but I run into this: I'm surprised because according to that I have replicated the User table. I look in my directories and I see myself with this:...
asked by 18.02.2018 / 22:15
1
answer

GATES de laravel. Restrict routes by role

The model is a user has many roles and a role has many users User model public function roles() { return $this->belongsToMany('App\Rol','usuarios_roles','idusuario','idrol'); } role model public function usuario...
asked by 10.06.2017 / 04:44