Most voted "laravel" questions
Laravel is an open-source framework for developing web applications and services with PHP. Before asking consult the official documentation of Laravel.
Learn more…2,777 questions
Sort by count of
-
1
votes2
answers139
views -
1
votes1
answer241
viewsDocker
I am setting up a development environment with Docker. In it I need NGINX (webservice) PHP 7.2 (app) MARIADB 10.3 (database) In the container app I must install Composer, I will work using Windows.…
-
1
votes1
answer331
viewsValidate non-mandatory fields using Laravel Validation 5.8
I would like to validate a field and make that field not mandatory. I know that for him to be obligatory I must wear required but I didn’t use it, since I only wanted to validate an email if it was…
-
1
votes1
answer433
viewsUndefined variable: page (View: ... Resources views layouts app.blade.php
Variable does not work when logging in. in the login view I’m injecting the layout: @extends('layouts.app') and in the layout has the variable <p class="num">Telefone:…
-
1
votes1
answer3143
viewsWhat to do to call a function from another controller in Laravel? I would like to implement best practice
I have a boletosController controller need to call the Function create in the tradeController; boletosController.php; namespace App\Http\Controllers; use App\Repositorios\Boletos; use…
-
1
votes0
answers68
viewsError values props js
In the console browser displays this warning every time it selects a data in the form field, how do I resolve ? I set a component pai form complete separate I call on formfilho in another component.…
-
1
votes0
answers118
viewsReact + React Router + Laravel => error while performing refresh or insert url manually in browser
I’m using React for the front of an application in Windows. In React, through the React-router I am accessing components dynamically through the parameters passed via url by the router link. If you…
-
1
votes1
answer83
viewsMigration in more than one bank
I need to turn the remote php artisan migrate and each Migration go to your respective database, I have the following code on .env: DB_CONNECTION=mysql DB_HOST=163.25.138.18 DB_PORT=3306…
-
1
votes1
answer488
viewsAJAX in the Laravel
I am trying to send data to my controller using AJAX but am getting the following error: AJAX error: error : Not Found What can I be doing to solve this problem? follows the codes: route:…
-
1
votes1
answer244
viewsInner Join Laravel - Erro Where clause is ambiguous (23000)
I am learning how to use Framwork Laravel and I came across the following error to perform an Join Ner (remembering that I already have a database with information so I am not used Migrations)…
-
1
votes1
answer337
viewsIssue with route in Laravel; my page does not access the bootstrap files that are on the layout page
I would like a little strength, I am starting with Laravel 6 and I have the following problem; I have a layout page inside the "views>layouts" folder called "admin.blade.php": On it are my…
-
1
votes2
answers107
viewsRegistering data with Laravel
I cannot return the user to a particular page after registering a registration form, the data goes to the database normally, but returns an error. My class of Controller class AccountController…
-
1
votes1
answer121
viewsHow to perform a consultation in the bank applying "exceptions" with a relationship?
I need to get all users with "Exceção" those of the function containing the id=2, it is possible? You can fit a Where in that consultation? I have the following consult at the bank Laravel which…
-
1
votes1
answer125
viewsDoubt between relationships with Laravel and Eloquent
I have the following model, using Laravel 5.8 I ran all the records and structured the relationships. On my Dashboard I need to list in card form all reports from a specific user. How could I do…
-
1
votes0
answers251
viewsPOST form button does not work on Laravel 6
I am trying to send the data of a Login form by the POST method, however it is not going at all, nothing appears error. Just follow my code Form <form class="form-group"> {!!…
-
1
votes1
answer68
viewsHTML in DB with Laravel 5.8
I have several fields on a page that use ckeditor: <label for="PublicoAlvo">Público Alvo</label> <textarea name="publico_alvo" id="PublicoAlvo" rows="10" cols="80"> Coloque aqui o…
-
1
votes1
answer58
viewsError while running Migration
Error: 1005 Can’t create table 'cobranca_simples. #sql-f04_1f0' (Errno: 150) (SQL: alter table carteira_cliente add Constraint carteira_cliente_carteira_id_foreign Foreign key (carteira_id)…
-
1
votes1
answer69
views(Mutators or Middlewares) What would be the ideal use when converting a string before inserting it into the database?
Which would be more recommended to use when manipulating a string that in this case would be (,) for (.) when inserting a value in the database (Mysql) of decimal type in Laravel? 1 - Using a custom…
-
1
votes2
answers455
viewsInquiry Manually Transaction Secure Pay Checkout
Hello, I am Trying to make a Transaction query manually by following the template passed by the author of the michaeldouglas/Laravel-pagseguro component, but when I try returns the following error:…
-
1
votes1
answer43
viewsAre both error treatments the same?
I have a great doubt regarding a visualized code regarding the handling of errors, I have 2 options for handling errors, one is being used a lot in a system that I am doing, and the other is the try…
-
1
votes1
answer487
viewsProblem uploading images to Laravel 6 with Ajax
Currently I did a mini file upload project using the Asynchronous File Uploader (Ajax) and it worked. I went to try to upload images using ajax and my request is returning null, so I can not…
-
1
votes1
answer144
viewsAdditional Fields in Pivot Model Laravel 6?
I’m in my first Laravel Framework project and I’m having difficulty in relationship N:M, I have the database structure fornecedor->fornecedor_produto->produto** have my models: class…
-
1
votes1
answer402
viewsLaravel - Eloquent Many to Many
I have this structure Migration from the Exercise table public function up() { Schema::create('exercicio', function(Blueprint $table) { $table->increments('id');…
-
1
votes1
answer136
viewsHow to configure the pdo_mysql driver in Laravel 6
Laraveldoctrine ORM Exceptions Drivernotfound : Driver [pdo_mysql] not supported. My database.php configuration file is as follows: 'mysql' => [ 'driver' => 'pdo_mysql', 'url' =>…
-
1
votes1
answer1155
viewsProblem running Migrations on Laravel
I am trying to run the Migrations on the Windows and bumped into the following error, do not know if and connection to the database what can be Illuminate\Database\QueryException : SQLSTATE[HY000]…
-
1
votes1
answer51
viewsLaravel query returns "wrong" result
I have a table called "tabela_precos", with the following structure: categoria_veiculo_id | valor | preco_min | preco_max | tipo_veiculo 22 77,70 0 2500 carros 22 30,35 15000 20000 carros When I run…
-
1
votes0
answers30
viewsuse Filter to bring Null andNon-@CAP_FIRST$null data to select
Controller: public function get(Request $request, Funcionario $funcionarios) { if ($funcionarios->id) { return response()->json(['data' =$funcionarios->toArray()]); } $rules = [ 'nome'…
-
1
votes0
answers26
viewsPick up box in the larable
I can’t get the information from the database. This is my controller. <?php namespace App\Http\Controllers\Admin; use Illuminate\Http\Request; use App\Http\Requests; use…
-
1
votes1
answer122
views{{ csrf_token }} Does not work
I am developing a form but csrf_token does not work: <form method="POST" action="/storeXML" class="form-inline"> <div class="container"> <input type="hidden" value="{{ csrf_token()…
-
1
votes1
answer273
viewsTrying to get the 'id' property of non-imposition with Array
I’m trying to get an ID from the database, but I get the following error: Trying to get Property 'id' of non-object... My code: if($provider == null) { $provider = array( 'provider' =>…
-
1
votes0
answers28
viewsError in Sending Ajax form
Hello, I need a help, when I try to send it displays the message successfully and dps displays the error message when sending, when I enter the dev mode of the browser and see the contact.blade.php…
-
1
votes1
answer358
viewsHow to customize authentication fields in Laravel 6
I’m trying to do a custom login with Laravel 6, but it’s not working. I have the following code: public function postLogin(Request $request) { request()->validate([ 'email' => 'required',…
-
1
votes0
answers244
viewsModule is not loaded in php.ini
Hi, I’m trying to download a Composer package and it points out that the Soap extension is not enabled. - nfephp-org/sped-nfe v5.0.97 requires ext-soap * -> the requested PHP extension soap is…
-
1
votes1
answer33
viewsLaravel. How to use request to perform APP search
Good morning gentlemen I am starting my studies in Latin working with version 6 of the framework, and I came across problem that is probably a detail that I missed in my code. When trying to perform…
-
1
votes0
answers82
viewsMysql usage with Laravel and table items records are disappearing what might be?
I have a mysql 5.7.29 database called "base_default" with collation and encoding according to the image below and the api uses Laravel 5.6. on this basis I have the following table structure: data…
-
1
votes1
answer201
viewsLaravel - To have a unique function of creation of the entity
After seeing a lot on the internet, I understood that I should not call a function of one controller in another and that the solution but elegant is to create a service, but I did not understand how…
-
1
votes2
answers173
viewsCan I use the dd() function in production?
I created a function that is called in another class to perform a task during a request in a Controller of my application. I put a return in that function to interrupt its execution in a specific…
-
1
votes1
answer103
viewsHow to print variable component in Laravel 7?
I have a $user variable in my Controller. So: public function index() { $userBiografia = "Biografia do Usuário"; return view('user.index', compact('userBiografia')); } I can print it peacefully in…
-
1
votes3
answers671
viewsConsume an API that requires authentication with Laravel
I’m creating an application with Laravel, which consists of consuming the Mcafee API. The previous version was built in pure php, from which it consumed the data of a Mysql database powered by a…
-
1
votes0
answers146
viewsDoctrine Inflector error while saving files in the database with Tinker
The error happens when trying to save the updates in the database, when I give the command $contact->save(); it returns me the error: PHP Deprecated: The "Doctrine Common Inflector…
-
1
votes1
answer87
viewsMore than one array value for Where Eloquent
I’m developing a route for my api, where it is intended to return a list of cities based on the fields and values of my array. Thus: public function arrayCidades(Request $request) { $ay =…
-
1
votes1
answer29
viewsQrcode class working only within route file
Inside the route file the following code works normally: QrCode::format('png') ->size(400) ->color(0,0,0,100) ->backgroundColor(255,255,255,0) ->margin(20) ->generate('google.com',…
-
1
votes1
answer66
viewsDisplay the input id data?
I have the method responsible for calling a page (View) which displays the data referring to the last id entered in the database and I am using the framework Laravel and ORM Eloquent public function…
-
1
votes1
answer471
viewsUpdate data in Real-time without refresh in Blade - Laravel
I would like to know how and what is the best way to update data in real time on a screen using Laravel. The situation is as follows: I will have a (edit) screen, which displays the items already…
-
1
votes1
answer717
viewsService, Model and Repository: where should logic, validations and possible external communication be?
I’m doing a small project for learning purposes using Laravel, this system revolves around two "models", Conta and Transacao. one Conta has name and balance, a Transacao has count_source,…
-
1
votes0
answers31
viewsQuery amount of storage consumed by a User
Good morning, I’m having trouble checking the amount of disk a person consumed. This was the query built, seeing several sites: SELECT table_name AS 'Nome da tabela', ROUND(((data_length +…
-
1
votes1
answer68
viewsHow to paginate an Laravel 7 array?
Is there any way simple to paginate an Array in Laravel? I have an array $calls what date a search makes the return of type: Until version 5 there was the method Paginator::make($atendimentos,…
laravelasked 4 years, 1 month ago Paulo Martins 390 -
1
votes1
answer73
viewsException in Laravel Request validation
I have a Request that validates the data. One of the validations is the unique to restrict the repetition of items. However, items are entered in categories. I need that when the item is of another…
-
1
votes1
answer73
viewsModel Variable returns null and not the model class
I have the model below and when I do a search that has data, it works right, but when it does not have it returns null, it was not to return the class of the empty model, without filling in the…
laravelasked 4 years ago Angelo V. Merlo 117 -
1
votes1
answer67
viewsHow to override the Laravel Illuminate Database Connection.php run method?
I need to customize the callback function call in the run() method of the Connection.php class, located in the frameword Laravel src Illuminate Database Connection.php The problem is that it is in…