Questions tagged as 'laravel-5'

1
answer

The value of variable is deleted when passing it from js to php

I'm doing a shipment by ajax from js to php. I am sending an array of objects using angular, here my code. $scope.updateRecipe = function() { //Se hace petición ajax para agregar el producto $http( { //Se elige el metodo...
asked by 19.01.2018 / 22:35
1
answer

count the number of elements that a request laravel 5.5 contains

I am trying to count the amount of data my Request brings but it returns the value 1, when in fact it contains 6 data. public function Guardar(Request $request) { echo count($request); }     
asked by 18.10.2017 / 17:25
1
answer

Check with a search engine in laravel

I wanted to know if the query is well done Where to find the posts of a blog that contain a word "query": public function search(Request $request) { //guarda la palabra en $query $query = $request->input('query');...
asked by 19.09.2017 / 00:16
1
answer

Laravel show articles ordered

How can I get a quantity of items ordered from the newest to the oldest (currently it appears from the oldest to the newest) in laravel 5.4 in the controller, the function of the home page home is like this: public function home(){ $...
asked by 29.08.2017 / 04:39
2
answers

Error Array to string conversion

I am trying to send two arrays to my BD, an array of activities and another array of points !! so the form, and the error that throws me is an array to string conversion I do not understand why, could you help me? error 1/2 is:...
asked by 05.09.2017 / 02:11
1
answer

Define a global variable to be used in several views independent of the controller of each view

I need to declare a globlal variable, something similar to: $user = Auth::user(); I am consuming an API and I need to get the $user variable in the login form in a global way to use it in the whole app. I am not very familiar with th...
asked by 02.08.2017 / 22:49
2
answers

error when relating by foreign key tables

I have an error when relating by foreign key, it generates the table but not the relation. I deleted the tables and I generated them again and nothing Use php artisan migrate link public function up() { Schema::create(...
asked by 17.08.2017 / 00:44
2
answers

Error updating a unique field

I have a problem updating the information in a role. In my database I have the attribute nombre_rol as unique . Registering a new role works perfectly, but when updating the same record, it gives me the error that the Role element i...
asked by 23.06.2017 / 04:48
1
answer

Login / registration form with Laravel 5

I have a login form and a registration form and the problem is with the email. If I do not add the email type in the validation rules: 'email' => 'required|unique:users,email', and without wanting to register an email with spaces at the...
asked by 24.05.2017 / 13:15
2
answers

Delete an item from a Collection

I have a Collection that comes to me from the route. This Collection has a relation, detalle , which is where I want to eliminate one of the objects that arrive, exactly the "qdet_ref" => "300_1_2" . At another time...
asked by 07.03.2018 / 11:59