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
-
2
votes1
answer669
viewsLaravel find() function giving error
When I launch a search with an id that exists in the bank, it works normally. Laravel 5.6 public function findProduto($id) { $produto = Produto::find($id)->with('imagemgame')->first(); return…
-
2
votes1
answer318
viewsIs there any way to generate Migrations based on an existing database in Laravel?
When I used Python’s Django, I was surprised by the command inspectdb, that is able to generate models based on an existing database. At Laravel, we have Migrations to work with the database, and I…
-
2
votes2
answers1897
viewsHow to do a subquery in eloquent Laravel with WHERE
Hello, I am using Laravel 5.6 and I am creating a query using eloquent Laravel, however I am having difficulty creating a subquery what I want to create is simple in SQL server: ,DT_ALTA = (SELECT…
-
2
votes0
answers85
viewsLimit of google maps requests expires with only 1 request in the Windows
Hello, I’m testing a google maps API for my project (https://github.com/farhanwazir/laravelgooglemaps) And when I just make a map request the API request limit expires, I’d like to know if anyone…
-
2
votes0
answers62
viewsHow to customize my Validator’s return key in the Laravel?
Currently my Validator returns as key the field that did not pass the validation, I wonder if it has to change to a generic name, as "errors" so I can browse the frontend. Follow the Validator:…
laravelasked 6 years, 1 month ago Middle Verona 21 -
2
votes0
answers174
viewsHow to load the data from the selected item?
Context: How do I load data from a selected template? Do I need to use Javascript? In positive case the code must be in an external file or in the same code? When the template is selected the…
-
2
votes2
answers433
viewsHow do I recover and calculate 2 numbers via POST in Controller in Laravel?
I am a beginner in the language and I am trying to learn by myself, I created a php .blade.file in order to fill two simple fields and return the calculation via Submit, after that I intend to list…
-
2
votes2
answers672
viewsReturn columns from belongsToMany Laravel pivot table
Good morning person. I created a search that returns requests and when I click opens the products of that request. However I cannot make the products appear as a string, only in array format as in…
laravelasked 6 years ago frodrigues 181 -
2
votes1
answer149
viewsHow to do Insert 1 to 1, with four tables in Laravel
I am working with a database already populated. It has four tables (Aluno, clinico, Familia and TipoCompulsao), where Aluno receives foreignkey of the three tables; Student model class Aluno extends…
-
2
votes1
answer141
viewsCreate Groups and Group Items Within Them
I have the following problem, I have a table with items and I need to create groups and name each item to its own group. I have already distributed them by categories, which in this case I call…
-
2
votes1
answer76
viewsPage loads normally but with 404 status
Has anyone ever seen anything like? http://engenhariamrc.com.br/admin It’s an Laravel 5.7 project hosted on the king host, the site is running normally on the local server, but on the web server it…
-
2
votes3
answers5245
viewsRun a specific Migration on Laravel 5.6
I’m in need of executing only one migration within my system laravel, not to affect the rest of it. Excerpt from the Migration: public function up() { Schema::create('notifications', function…
-
2
votes1
answer99
viewsTruncated data for the vlrDesconto Laravel column
I’m trying to save field with formatting by jqueryMaskMoney, but this giving truncated data error $("#desconto01").maskMoney({thousands: ".", decimal: ","}); Error: CONTROLLER public function…
laravelasked 6 years ago frodrigues 181 -
2
votes2
answers1224
viewsTaking data from an Laravel PHP Object
I am listing from the data of a query I made with the following code: $users = DB::table('users') ->join('transportes', 'users.id', '=', 'transportes.user_id') ->join('empresas',…
-
2
votes1
answer961
viewsPass parameter to route Resource | Orange
I’m developing a project control application. Each project has its tasks, that is, when I create a task, it needs to be linked to the project. I am using the Route Laravel feature. When I pass the…
-
2
votes2
answers2182
viewsLaravel Jobs Queue
I’m having a question, I’m trying to run the Jobs using the Supervisor to run Jobs, only the command doesn’t work with php Artisan Queue:work rather with php Artisan Queue:work --Queue=high, I’m…
-
2
votes1
answer363
viewsConsultation Eloquent select total
I am trying to group to bring totals in my query that is in mysql SELECT COUNT(*) as total ,e.descricao FROM pedido_cliente p INNER JOIN estabelecimentos e on e.id = p.estabelecimento_id GROUP BY…
-
2
votes1
answer58
viewsI can’t get into the foreach of a Lade at Laravel 5.7
I’ve got a little problem I haven’t figured out yet, I’ve got a View and I can’t get into foreach of the same, follows the View: <div class="form-group"> {!! csrf_field() !!} <!--{{…
-
2
votes2
answers761
viewsConnection between two Docker containers
I created 3 containers to start my application, they are: version: "2" services: mysql: image: mysql:5.7 container_name: rgsistema-mysql working_dir: /application volumes: - .:/application…
-
2
votes2
answers155
viewsError printing Styles and scripts in Blade templates?
I have a CMS that is using Elementor to generate pages dynamically, this saves my html css and script in the database. I had a problem with the tag issue <style> and <script> because…
-
2
votes1
answer56
viewsGet id of two html elements?
I have an array of inputs and use to record in the database /*ANSWERS */ foreach($params['questionnaire_questions_answers'] as $key => $item){ $student_anamineses_answers =…
laravelasked 5 years, 10 months ago Edinho Rodrigues 384 -
2
votes2
answers45
viewsProblems with Join Laravel ORM
Hello, I’m trying to create an advanced query, but I’m having some problems following the code for analysis! Anuncio::join('users', function ($users) use ($request){ $users->on('users.id' , '=',…
-
2
votes1
answer606
viewsHow to update an image to the database with Laravel?
I managed to upload the photos in the database, but I can’t update these photos, when it is updated it deletes the image from the database but does not use the new. I kind of tried to copy the code…
-
2
votes1
answer334
viewsHow to group ng-repeat in Angularjs
I need to group the Class field and list the tasks that exist, but I can’t do that with Angularjs. Here is my view: <div class="row"> <div class="col-md-12"> <div…
-
2
votes1
answer972
viewsLaravel: Pass parameters on routes
I am developing a CMS system, where I choose the component that the user that on your site page. In this line of code I load the data of the components, this data is coming from a file…
-
2
votes0
answers77
viewsOrange adding code with CRSF_TOKEN at the bottom of the page
I know a little bit about how the @csrf_token from Laravel, but I’m facing a problem. The code below is being added at the end of all my Views and this happens without me having implemented…
-
2
votes1
answer91
viewsCan I pass 2 Laravel array_encode?
I can pass 2 json_encode in a single function in the Laravel? What is the best way to return 2 JSON different? Where 1 consults the table Products and the other the table States. Look at this…
-
2
votes1
answer444
viewsError when running php Artisan migrate
I am trying to create the tables and this giving the following error: BadMethodCallException : Method Illuminate\Database\Schema\Blueprint::number does not exist. at…
-
2
votes1
answer389
viewsRelationship of Laravel Relationship
I have a model called Processo, this model has a relationship hasMany with the model Andamento, the model Andamento has a queryScope what use to return the data already with other relations of this…
-
2
votes3
answers1274
viewsHow to troubleshoot the error: Reflectionexception (-1) Class App Http Controllers admin Ufcontroller does not exist
Follow the code snippet route/web.php //Gerenciar UFs $this->group(['middleware' => ['auth'], 'namespace' =>'admin','prefix'=>'ufs'], function(){ //Inicio das Rotas de gerenciar os UFs…
-
2
votes1
answer329
viewsError While climbing Docker container
When I give a Docker-Compose up, the container goes up normally, but when I access the localhost, from error 500, the page is not working, and in the console the following error text appears. I’m…
-
2
votes1
answer402
viewsAccessing objects from a JSON
I have the following file .json, in case I want to access initial data, called suzuki at the beginning of json, how do I get this information? That one .json is responsible for making the data Seed…
-
2
votes1
answer1579
viewsCalculation of working days
Guys, I have some methods in PHP that return me the number of days between the initial date and the final date, however, I would like to receive as parameter, only initial date and number of days…
-
2
votes2
answers694
viewsPick up the return from one function to another in the Laravel controller
I have two functions in the controller and need to pass the return of a function to the other and save in a variable, but is giving error. function that returns public function…
-
2
votes4
answers839
viewsRetrieve data from the logged-in user to use as the sender of the email in Laravel
How can I make mail.php take the logged user data leaving the data of retemente dynamic. In the controller works, I can access the password of the logged in user. The problem is that in mail.php if…
-
2
votes1
answer774
viewsTake column name with foreign key
I have a product table that refers to id table categories, but do not want to take the number id of the foreign table, and yes the name of this reference. My controller is like this: public function…
-
2
votes1
answer49
viewsHow to enter stipulated amount of the same record in the database with different id in LARAVEL
I have a form that already creates one record at a time in the bank. I would like to inform in this same form through a quantity field ($request->Quant) where I can enter the amount to be created…
-
2
votes1
answer299
viewsSave items from a Checklist form in the database - Laravel
I have a Checklist form that is generated dynamically. When saving the array persists in the error message: Array to string Conversion (SQL: update checklist_protocolo set projeto_id = 4, modelo_id…
-
2
votes1
answer127
viewsLaravel 5.8 - Validation - pass value of one input to validate another
I would like to check if there is a possibility in the formRequest validation to pass the value of one input as a parameter to validate another. Example: Inputs 'company_id', 'email' in formRequest…
-
2
votes1
answer104
viewsLaravel sort items from one table from the values of another
I have two tables, a call proposals and another propostas_items propostas -id -nome -descricao propostas_itens -id -proposta_id -quantidade -valor A proposal has many items, I need to list the…
-
2
votes1
answer341
viewsRelationship N to N with 4 tables in Laravel 5.6
Good afternoon, you guys, I started using the framework Laravel a little while ago and I’m having difficulties in implementing a relationship N/N using 4 different tables. The scenario is as…
-
2
votes1
answer167
viewsPossible safety failure using Laravel?
I’m helping set up a canvassing system. And I ended up running into an incident that I was a little bit in doubt whether it was something ordinary or something that could become a vulnerability in…
-
2
votes1
answer133
viewsWherein problem using array
I have a system where I need to list some employees. This listing will depend on the supervisor’s department code. Ex: If the supervisor is from department 206, he can access all data from the…
-
2
votes1
answer210
viewsTake the last value of an Array inside a Foreach
I’m making a foreach which brings the following database: $notificacoes = Notificacoes::where('user_id', $id) ->where('lido', false) ->orderBy('created_at', 'desc') ->get();…
-
2
votes1
answer128
viewsVariable validate returning wrong answer
I have a 2 check uploads on a form with the validate in the following function: public static function validarComprovantes($request) { $request->validate([ 'pagamento' =>…
-
2
votes0
answers31
viewsPHP Mail class does not load variables in the View
Laravel keeps returning me as an undefined variable, for the $bloger variable. I’ve tried every way I know how, but the mistake persists. I already loaded the view through the controller and it…
-
2
votes1
answer44
viewsconfig() does not return what was configured
I have a class Foobar.php that in it have a return [] with some items that are pointed out from .env, in this format: Foobar.php: function decode_ifnot_null() {} ... // método que auxilia na…
-
2
votes0
answers31
viewsHow to use jQuery.validation in Checkboxes generated by jQuery.Repeater?
I am using Dubfriend/jquery.Repeater to repeat some fields in a form, proengsoft/Laravel-jsvalidation to export Laravel validation rules, and jQuery.validation to validate them. Checkboxes processed…
-
2
votes1
answer323
viewsTesting CRUD made in Laravel with phpunit
Expensive, I have a simple CRUD, appearing only the description field on the screen, and the code is generated by the database. I want to put together a script to test: - inclusion - see if it…
-
2
votes1
answer551
viewsLogin error message does not appear - LARAVEL 5.8
My application has a login system done in the Windows with the command php artisan. But when the user misses the password or the email, the system just reloads the page and does not return the error…