Most voted "laravel-5" questions
Laravel is an open-source framework for developing web applications and services with PHP. Use this tag for specific questions about Laravel 5 or later.
Learn more…751 questions
Sort by count of
-
1
votes1
answer767
viewsMulti-Insert with Laravel 5.3 dynamic form
I am trying to do a multiple Insert with Laravel 5.3 in a table as follows: Form {!! Form::open(['route' => 'demanda.store', 'class' => 'form']) !!} <div class="form-group form-inline">…
laravel laravel-5 laravel-eloquent laravel-5.3asked 7 years, 10 months ago José Cicero Rocha Cavalcante 11 -
1
votes2
answers3113
viewsHow to check if the entity already exists in the bank
I am currently working with models, Migrations, Seeds and fakers (Factory) for database testing. So far I’m ordering to insert 1 admin, whose code I present: DB::table('users')->insert([…
-
1
votes1
answer367
viewsOrange Push and Native React notification
I have a web application developed in Laravel, where I register clients, register orders for each client where an order code is generated and for each order I register the steps. This application…
-
1
votes1
answer599
viewsHow to check if an array has an attribute?
I’m using Laravel 5.4 in an application, and a validator method receives a array. That one array can have the attributes: [ 'nome' => $request->nome, 'ddd' => $request->ddd, 'fone' =>…
-
1
votes1
answer250
viewsHow do I mount a select with two fields using colletivehtml in 5.5?
Good afternoon. I use Laravel 5.5 and for forms I use laravelcollective. I mount a select this way: $locals = Local::get()->pluck('codigolocal', 'id'); and the result is a select with the value =…
-
1
votes1
answer370
viewsForm::select Orange
I’m having trouble making one Form:select searching information from the database. How is the Controller; public function create() { return View('internos.create'); } How’s the View; <div…
-
1
votes2
answers2424
viewsTrying to get Property of non-object?
This is my View: <tbody> @if(isset($pessoas)) @foreach($pessoas as $p) <tr> <td>{{$p->nome}}</td> <td>{{$p->idade}}</td>…
-
1
votes1
answer598
viewsWrite Hmtl Table data to Database | Laravel 5.1
I have a question regarding recovering the information from an html table and saving it in the database using Windows. This part of the application consists of storing in a table user_exame…
-
1
votes1
answer2516
viewsHow to download a file to the server with php Laravel
I would like to know how to download an image or video using Laravel and save on my server direct, taking a url as example: https://brandmark.io/logo-rank/random/beats.png?
-
1
votes1
answer226
viewsQuery problem using DB Where/orWhere Laravel
Good afternoon friends, I’m having problems with a query using DB in the Windows, I put a clause Where and another orWhere and a whereBetween, but it is not going through the between, and when…
-
1
votes1
answer51
viewsJoin with sum in Laravel
I am trying to bring a JSON result from my database. $products = DB::table('products') ->join('order_product', 'products.id', '=', 'order_product.product_id') ->select('products.sku',…
-
1
votes2
answers108
viewsRoute envelope
In my file Routes > web.php I have the following routes: Route::get('/user', (...)); Route::get('/user/{id}', (...) ); Route::get('/user/{id}/{nome}', (...) ); // retorna o nome e id do usuário…
-
1
votes1
answer622
viewsCreating and checking session - Laravel
Good evening guys, I’m new using Laravel and I was creating something basic products, and I’m having doubts regarding the use of session in Laravel. After the user logs in, as I can create the…
-
1
votes1
answer151
viewsHow to filter by method? Laravel 5.4
I need to filter all images that have a specific link, I was able to filter through the status of the product table, but what connects the image to the product is the method image(); class Produto:…
-
1
votes0
answers266
viewsChart.js error in Laravel?
Guys I’m trying to use Chart.js in Laravel through their own lib, but returns me the following error: Call to Undefined method Fx3costa Laravelchartjs Builder::size() I do not know what can be, I…
-
1
votes2
answers1776
viewsAjax request url point to a route
I set the following route in my route file: Route::post('order/productsByCategory', ['uses'=>'OrderController@productsByCategory']); How do I use it in my Ajax request ? $.ajax({ url: "", type:…
-
1
votes1
answer248
viewsWhere are the log-in routes in the Laravel?
I registered some authenticated routes (I already have the authentication pages created with the make:auth) and they work right, every time I try to access these routes in an anonymous tab it falls…
-
1
votes0
answers36
viewsHow to do a Cron task with Laravel?
I have a Function in php/Laravel, and would like to fire this Function every 2 hours and 35 minutes. My question is: Using Laravel, as I create correctly, a cron to trigger this function in this…
-
1
votes1
answer332
viewsDiscovering last vector item in the foreach?
I need to know what is the last item of the vector so that when it is the last one does not add a comma: Example: SEM SABER QUAL É O ULTIMO ITEM 1,2,3,4,5, SABENDO QUAL É A ULTIMA VIRGULA 1,2,3,4,5…
-
1
votes1
answer423
viewsForm on Laravel 5.4?
I’m having a hard time trying to create a form on Laravel 5.4, at the time of loading View appears the following error: "Errorexception in helpers.php line 532: htmlspecialchars() expects Parameter…
-
1
votes1
answer60
viewsHow to recover an interval of months between two dates?
public function getMesesAtraso() { $data_debito= date_create($this->data_debito); return date_diff(date_create(now('m')), $data_debito)->format('%m'); } Returns only months in 2019…
-
1
votes1
answer639
viewscompile mix Standard 5.4
Hello, I have a problem in Laravel 5.4 I am trying to put a personal js library of mine and I am not getting and remove Vue my package.json { "private": true, "scripts": { "dev": "npm run…
-
1
votes1
answer2010
viewsHelp with relationships in the Flat
I am really enjoying using Laravel 5.4 and I have some doubts about the relationships and how best to use it have the tables evento -id -nome categorias_evento -id -id_evento -nome lotes_evento -id…
-
1
votes1
answer54
viewsGROUP_CONCAT (CONCAT... in Laravel?
I don’t know if anyone can help me I needed to execute this SQL in Laravel I just don’t know how to use the GROUP_CONCAT with the CONCAT within? select dictionaries.name,…
-
1
votes0
answers20
viewsGeneral check in Laravel
I have a site in Aravel with an administrative panel. I would like to know how to implement a general check. For example: In my control panel I have a screen of site parameters, with a checkbox that…
-
1
votes0
answers602
viewsSlow mailing with Laravel?
I’m doing some mass mail testing but I’m finding it a bit slow the process being done with Laravel. The reason I was finding sending it slow is that I worked in a company where on average 50~60,000…
-
1
votes2
answers976
viewsResult field name instead of id on Laravel 5?
I have a relationship in Laravel but when I make an appointment comes the id and not the name of the field. Model Evento public function tipo_evento() { return…
-
1
votes1
answer23
viewsConvert SQL to Laraval Eloquent 5
I’m trying to turn this SQL from the postgres below to the eloquent in the laraval someone has an idea of how it would look? select g.id as group_id, max(g.name) as name, max(g.created_at) as…
-
1
votes2
answers940
viewsLaravel eloquent returning array of array
I have this consultation using eloquent $data= \App\Logs::select('id', 'created_at') ->get() ->groupBy(function($val) { return Carbon::parse($val->created_at)->format('d-M-');…
-
1
votes1
answer308
viewsRelationship Many to Many with select multiplo in Laravel
I have the Post and Tag models with a Many to Many relationship. When registering a post the previously registered tags appear normally in select and I can save in the bank. In the edit form I am…
-
1
votes1
answer693
viewsNotifications/Mail com Laravel
I’m having trouble firing notifications with Laravel 5.4, I’ve already followed the steps of the documentation, but was unsuccessful. Follows my code \Larashop Users Notifications Messageuser…
-
1
votes1
answer4875
viewsHow to make specific sql queries using Laravel?
I need to make an appointment at the bank to see the birthday of the current month. A consultation of this type, see: SELECT * FROM membros WHERE day(dataNasc) = day(CURRENT_DATE) and…
-
1
votes0
answers25
views -
1
votes1
answer431
viewsAPP_URL of . env record entire URL (in addition to the domain) of the application
I have a server with a domain where there are several Laravel applications, for example, the path of the application1 is like this: https://dominio.com/aplicacao1/public The problem is that when I…
-
1
votes1
answer246
viewsHow to make paging in a table that this related Laravel 5.4
There is a 2 tables and a pivot where she makes the relationship ManyToMany among the 2 tables. A table is called Postagems and the other table is called Departamentos, so I’m trying to do a related…
-
1
votes1
answer678
viewsSum of quantity multiplied by product value in daily sales
I have an order page, let’s take as a base a mercantil, where the person buys 3 sodas each with the value of R $ 6,00 and 2 cookies in the value of R $ 2,00 each. First I need to multiply these…
-
1
votes1
answer106
viewsLaravel Unit Tests. I can’t instantiate the class
my problem apparently is simple but I can not solve. I decided to do tests on my application, and at first I had problems I run the following command line to run the test: vendor/bin/phpunit In the…
-
1
votes1
answer608
viewsLaravel 5.5 - Validation Method does not exist?
I’m having problems performing a data validation in the version 5.5, can you tell me where I’m going wrong? Error: Here is the code of Controller <?php namespace App\Http\Controllers\PainelAdmin;…
-
1
votes0
answers753
viewsHow to use Eloquent without losing performance (51.39%) in Lumen 5.4?
Developing an API that should handle a high performance website. Doing some tests I verified that the use of Eloquent is downloading the performance of the requests in the database Mysql in 51.39%…
-
1
votes1
answer39
viewsWorking with Routes in Laravel
This is the structure of my project where my page is; This is my controller; public function create() { return view(imoveis.create); } It is configured so my route, is in my file web.php;…
-
1
votes1
answer1490
viewsHow to test the cron in the Laravel?
I created a cron for sending email every period of time. But how to test the operation ? Code <?php namespace App\Console\Commands; namespace App\Console\Commands\EnvioEmailBlCron; use…
-
1
votes0
answers201
viewsHow to configure Laravel on Heroku?
Greeting to all, I put an Laravel project in Heroku, and can configure the data group with my Laravel project, or if, manage to migrate the database using php commands in Heroku, to be able to make…
-
1
votes0
answers448
viewsHow to load select in Vuejs
I managed to implement the edit button, by clicking the button it will load all the records that exist in a database in a folder, I can load all fields except the selects. The problem is I’m not…
-
1
votes0
answers65
viewsThe Heroku server does not recognize my vueJs file
I made the deploy of my Laravel project as shown in the video below: CLICK ON THE VIDEO Everything worked out, but when I went to load the page again appeared this: When trying to perform any…
-
1
votes1
answer126
viewsI need to make my Javascript file see the Vue and Axios files
I recently created an Laravel project that is using Vuejs and Axios, and then sent it to the Heroku server, but something strange happened, the page is with the very strange view is giving error in…
-
1
votes0
answers213
viewsInserting data in the 1:N - Laravel 5 ratio side 1
I have the following tables, Condominios and CondominiosTaxas, that are a relationship 1:N , respectively, my relationship in the model Condominio: public function Taxas() { return…
-
1
votes1
answer188
views -
1
votes1
answer289
viewsMore of a relationship with the table below
I have a Receivables table that has a relationship with the Customer Table and TWO relationships with a Chart of Accounts table* I searched the Eloquent documentation but couldn’t find out how to…
-
1
votes1
answer654
viewsSession in Laravel 5
In my controller, log in as follows: if(!empty($input['user'])) { $result = $this->userRepository->searchuser($input['user']); //Busca o usuario pelo login // dd($result['data']['user']); if…
-
1
votes0
answers89
viewsLaravel 5.5 Array Diff with bug?
I am developing in Laravel 5.5 and Php 7.1.9 and came across the following problem: I have the following Checkboxes screen and when marking any of the fields, the arraydiff of Laravel insists on…