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
-
0
votes0
answers243
viewsProblem with Axios headers | Application => Laravel + Vue.js
I am trying to make a request with Xios, but I can’t always get the following error: admin:1 Failed to load http://minhaurlencurtada: Response to preflight request doesn't pass access control check:…
-
0
votes0
answers55
viewsModel Relationship with Column Name Alias
I’m making an appointment with union in Laravel. $first = Friendship::selectRaw('id, userid, friendid, friendid as friend') ->where('userid', '=', $idUser) ->where('confirmed_friendship', '=',…
-
0
votes1
answer142
viewsHow to use Laravel Pagination with queries in raw DB::select() format
To get some database information at times it is simpler to make a querie with raw sql than to use multiple models, maps functions and a magic touch to reach the same goal, however the problem of…
-
0
votes1
answer132
viewsI cannot correctly pass the arguments to the function that updates data in the database (Laravel)
I am using Laravel 5.6 and came across a problem at the time I try to edit database records: Step from the table that shows the data and options (edit, delete, etc.), to the edit page, and when I…
-
0
votes2
answers985
viewsLogin customizado Laravel
I’m trying to do a custom login on Laravel 5.5, I can even authenticate the user, but when I direct to another page it loses the authenticated user reference and redirects to the login screen again.…
-
0
votes0
answers205
viewsHow to create a migrate and add a calculated column to an existing table in the database?
I have the ratings table that has the columns Nota1, nota2, nota3, nota4 created in the database and wanted to create a media column that already computes the media automatically, how to create that…
-
0
votes1
answer271
viewsProblems traversing nested json
I have a sponse in json I’m having a problem walking through it, the first is that I can only get to a part of the json and not at the value I want, the second that is conseguente of the first is…
-
0
votes1
answer144
viewsLaravel activitylog, error in implementation
I’m following the documentation of the site: https://docs.spatie.be/laravel-activitylog/v2/basic-usage/logging-activity, but I’m not able to implement the option below: Setting a You can specify on…
-
0
votes1
answer32
viewsMy url does not receive the id parameter in the display? id=. Why?
Question: My url does not receive the parameter id in the mostra?id=. Code: <table class="table table-striped table-bordered table-hover"> <?php foreach($produtos as $p): ?> <tr>…
-
0
votes0
answers96
viewsGet the balance of the previous month every month dynamically
How do I get the previous month dynamically; I have the Inputs and Outputs. In my report I show the Balance of the month (Inputs - Outputs), then I show the balance of the previous month, This works…
-
0
votes1
answer110
viewsProblems with the return of the query in Laravel 5
Hello, I’m having trouble with my Laravel research function class PesquisaController extends Controller { public function pesquisaMonitoramento(Request $request, Monitoramento $mot) { $mot =…
-
0
votes1
answer45
viewsDoubt relationship One to Many
Talk guys, all right? Next, I’m banging head with the Seed of my BD in Aravel, I believe that those who have more experience with the framework know how to solve. I have the Person model with One to…
laravelasked 6 years, 3 months ago user122305 -
0
votes1
answer174
viewsCompare two tables in mysql by grouping the main table and listing the result of the second table
Hello! I will explain from the beginning.. I am comparing the following tables accounts with clientes select uses the user_id to find all customers with same users_id2 on the table clientes as…
-
0
votes1
answer165
viewsDecrease php hours
I’m having trouble fixing the time to decrease it in php. My idea take the time that comes from the database and decrease with the current time and bring the rest , however. code I’m using as an…
-
0
votes1
answer677
viewsNot to pass an element ID through the Laravel URL
This is my route: Route::get('empresas/deletar/{notice}', 'EmpresaController@deletar'); This is the action of the button: This is my role in Controller: What happens if I pass this URL directly in…
-
0
votes0
answers373
viewsError: mb_strpos() expects Parameter 1 to be string, Object Given
Context: When trying to delete the object Structure checklist the following error occurred: mb_strpos() expects parameter 1 to be string, object given How to solve this problem? Information from Dev…
-
0
votes0
answers24
viewsmysql relations in Laravel 5.5
I’m trying to model with Laravel a database for purchases, in my mysql relations are like this, so I modeled on Laravel, for the associative table "vendor_detail_item" I used "belongstoMany"…
-
0
votes0
answers98
viewsLaravel Spatie Model Status
I need help implementing a request status. I am on a project that in the order session, I detail a specific request. Inside it will have a selectto select the STATUSof the request, if it was pago,…
-
0
votes1
answer75
viewsSaving data in Angular API
I need to save a data set through an API. I tried to pass the data in several ways but did not succeed. Always gives the error: ERROR Error: Uncaught (in Promise): Httperrorresponse:…
-
0
votes2
answers462
viewsHow to format numerical data extracted from the database for monetary values?
I’m using the library jquery.maskMoney.js to format the system’s monetary data. But when data is saved in the database and returned to the system screen formatting is lost. How to resolve this…
-
0
votes1
answer241
viewsPusher Error - Uncaught Referenceerror: Pusher is not defined
Good morning. I followed this tutorial to the letter: https://pusher.com/tutorials/chat-laravel But I get the following error in the browser console: Uncaught ReferenceError: Pusher is not defined…
-
0
votes1
answer317
viewsError logging in to Laravel
Personal I’m with login error in Laravel: Autenticacaocontroller.php public function logar(Request $request){ $dados = $request->all(); $cpf = $dados['cpf']; $senha = $dados['senha']; $usuario =…
laravelasked 6 years, 2 months ago Italo Rodrigo 4,344 -
0
votes0
answers89
viewsSlim Framework does not recognize the saved sessions
Guys, my directory in the slim framework was default.. /public /vendor /src /cache /app among other folders.. and within the /public A index.php was calling the other files and folder normally..…
-
0
votes1
answer31
viewsHelp with middleware group
My web.php file looks like this: Route::get('/login', 'AutenticacaoController@login')->name('autenticacao.login'); Route::post('/logar',…
laravelasked 6 years, 2 months ago Italo Rodrigo 4,344 -
0
votes2
answers651
viewsLaravel - How to configure project to open in XAMPP?
I have a project in Laravel, but for a specific reason I had to uninstall XAMPP and install again. Now I can’t remember what to change in the XAMPP configuration files to make the project run. I’ve…
-
0
votes1
answer1504
viewsError Handling Problems - PHP Laravel
I’m doing an API and I have a little problem when I do error treatments.. To better understand I’ll put the code below and then explain what happens. My route to calling my API: Route::get('lists',…
-
0
votes1
answer2034
viewsPlace error message in Laravel 5.6 view
Good night, you guys. I’m having trouble returning a friendly error message to the user if he tries to register an employee with an email that is already saved in the database, since in my table…
-
0
votes1
answer35
viewsDoubt with route
I’ve been trying for a while to make a route work, but so far nothing... Controller: public function profissionais(Request $request, $id){ $vinculo = session()->get('vinculo'); $profissionais =…
-
0
votes1
answer51
viewsReturn variable inside if to move to view
i want to write a code so that the user chooses an ID in a combobox and specific information is shown in HTML, but I need to do an if to know if the chosen provider is A, B or C, but I can’t return…
-
0
votes0
answers1129
viewsError 500 after deploying Laravel application using Mysql on Google Cloud Platform
I have an Laravel application using Mysql 5.7: https://github.com/01viniciusmelo/app-login-laravel In my local environment is working perfectly. I followed this tutorial, but the result is an error…
-
0
votes0
answers89
viewsSchema Soap Laravel Problem
Hey there, guys. I’m trying to connect to a Soap webservice using the Laravel. First the webservice is on a vpn, so I need to do a proxy, but I’m having trouble consuming. My mistake is this.…
-
0
votes1
answer119
viewsCreate query in query Builder - Standard
I’m starting to work with Laravel and need to make a query in the database, is a simple query, but as I’m starting I do not know yet perform it. I need to get the sales done today, yesterday, this…
-
0
votes1
answer691
views"Undefined Property: stdClass::$email" Laravel
My Validator returns the existing errors in the request. I would like to check if in the variable I save my errors has the error email to return the correct answer. I tried something like: public…
-
0
votes1
answer1863
viewsUndefined index Laravel
When performing a request I’m getting undefined index. The code in question: protected function create(array $data) { return User::create([ 'name' => $data['name'], 'email' => $data['email'],…
-
0
votes1
answer114
viewsPractical Example of Working with Eloquent in Laravel 5.6 (Relationships)
I have an entity that is employees and other 3 tables that are Sector, Office and Department and the relationship is 1 for N (i.e., the primary keys of these 3 tables must become foreign in the…
-
0
votes0
answers69
viewsEvery time I click to go to another page, ask for the login again (LARAVEL 5.6)
Good afternoon, everyone Every time I go to another page my application asks to redo the login Follows route Route::get('/', function () { return view('welcome'); }); Auth::routes();…
-
0
votes2
answers38
viewsExpose an object ( based on request ) for every application
Oops, I don’t know if it’s possible to do what I want, but come on: I have a Lumen api that basically reads a specific request header and parses it into a YAML file and turns it into an array, but…
-
0
votes1
answer30
viewsError executing Python3 script (with Symfony/Process) in an Laravel Controller
I’m trying to run a script in Python3 that I developed, which is located in a folder within the "Folder app" of Laravel. One script is called by a Controller and the other by an Artisan Command.…
-
0
votes2
answers164
viewsHow to filter Combobox data using Laravel Framework?
Context: I want to carry the models of Template Checklist in the combo, but only those that are not in the database table checklist_structure. In this case, only the Catu model would be loaded,…
-
0
votes1
answer340
viewsProblem with PUT Laravel
I’m using Laravel 5.6, routes and controller with Resource and in scritpt Post the code works normally, but with PUT it always gives error. Follow the working code of the POST const fileInput =…
-
0
votes1
answer230
viewsLaravel Mail, Error: Undefined variable
Good evening friends, I’m having a problem, when I try to pass the variables from one control to the other, he ends up accusing that the variable "was not defined": (Undefined variable: Black and…
-
0
votes0
answers22
viewsPaginate query in Windows using DB::table
$role = $request->id_cliente; $data_inicial = $request->data_inicial; $data_final = $request->data_final; $vendasCliente = DB::table('venda') ->join('cliente', 'cliente.id_cliente', '=',…
laravelasked 6 years, 2 months ago Daywison Ferreira Leal 167 -
0
votes1
answer391
viewsHow to recover data from checkbox as "checked"?
Context: I’m creating the method of "Update Structure", depending on the selected model the items must be marked in the Checkbox. But for some reason it is not working. How to solve this problem?…
-
0
votes1
answer203
viewsProblems authenticating users of different types - Laravel
In my system I have two models, the User (User) and the Client (Client), each type of user will have their roles defined. Example: User: Administrator Official Client: Manager Accountant Human…
-
0
votes2
answers399
viewsHow to make a @foreach with Relationship Tables in Laravel
I’m using Laravel freamwork where in my database I have 2 tables: -> complainants (with the field 'id','complainant','typoacoes_id') -> typos (with id fields, 'name') Both are already with the…
-
0
votes1
answer31
viewsExport array globally with Laravel framework
Eai galera! I’m working with Laravel on a project, and I came up with a question even being (idiot). I have structured all my controllers, models and views, but I have a view called: base.blade.php…
-
0
votes0
answers30
viewsError trying to deploy, Repository access denied
I am developing in Laravel, and I can’t use the deployer to deploy to our server in Amazon, our deploy.php looks like this: and we’re getting this bug, notice I seem to be in the right repository…
-
0
votes1
answer3569
viewsAjax (POST) Laravel
I am having the famous error 419, that for a certain moment I was able to solve, but after restarting the server, it stopped working. Route: Route::post('ajax/Register', 'Ajax@Register');…
-
0
votes1
answer112
views -
0
votes1
answer72
viewsLaravel Excel I do not understand what is being filled
I do not understand what is happening in this code that fills a cell B8 in excel: $sheet->cell('BQ'.$i, function($cell) use($report) {…