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
votes1
answer263
viewsHow to display Data in datatables in the Laravel with related tables
In the image we have the student table that is related to discipline and discipline with teachers. I want to know how to display the data of these tables in a datatables in the language…
-
0
votes1
answer509
viewsHow to validate a token?
I have an api in Passport, in my front end that is in React I created a private route, in this private route I called a function checkAuth, to know the user ta authenticated, but for now I made this…
-
0
votes1
answer236
viewsHow to realize the Seed of a Factory within another class with Phpunit/Laravel?
I was studying the framework Laravel, and I was left with the following doubt: there is a way to realize the Seed of a factory within a common project class? It would be like calling command php…
-
0
votes0
answers219
viewsCreate automatic pagination with Laravel and jquery
I need to create a manual pagination in the Standard. I don’t really understand the logic of this topic: Manual Paging in Laravel 5.1 But I need to make him create the automatic pages. Not manual.…
-
0
votes1
answer192
viewsCall to a Member Function Pluck() on null
In the following code, the following error occurs, which I cannot understand why: Call to a Member Function Pluck() on null public function edit($id) { $user = User::find($id); $roles =…
laravelasked 5 years, 3 months ago Albino Mateve 1 -
0
votes2
answers93
viewsHow to implement two Request to validate individual and legal fields?
If the type of person selected is F is valid through the FisicaRequest public function store(FisicaRequest $reqFisica, JuridicaRequest $reqJuridica) { if ($reqFisica->tipo_pessoa == "F") { $data…
-
0
votes0
answers105
viewsUpdating in the database
There is an error in the family composition, which says: Undefined variable: compositionFamiliary the family composition code is: $composicaoFamiliar = DB::table('membro_familiar')->insertGetId([…
-
0
votes1
answer53
viewsSearch using model
I would like to use my model to do research on Laravel. I wish that, if possible, one could explain to me: I have my model class minhaModel extends Model { protected $table = "minha_model"; public…
-
0
votes1
answer118
viewsLaravel and Ajax - Doubt about route
Using the Framework Laravel 5.5, How do I call the following route in Ajax? Route: Route::group(['prefix' =>'paineladmin', 'namespace' =>'PainelAdmin', ], function(){…
-
0
votes2
answers273
viewsHow to insert value in BD only if it does not exist, using Laravel
I’m trying to automatically register a value in the database using Laravel. I’m struggling to think of an efficient solution to this. Below is the example of what I want. $email = '[email protected]';…
-
0
votes1
answer130
viewsHow to Design Wamp for Lamp
I have a Windows finished project (wampserver) using Laravel 5.2 in php 5.5.12 working perfectly. I’d like to know how to copy it to the server that is in Centos 7. Which is PHP 7. If I install…
-
0
votes1
answer41
viewsHow to change JWT payload in Laravel?
I need to change my payload of my JWT to match the example below. { "iat": 1566408228, "exp": 1566426828, "email": "[email protected]", "name": "Fulano Silva", "roles": [ "manager" ] }…
-
0
votes1
answer365
viewsHow to pass form parameter for an Laravel route in an API?
Errorexception in Urlgenerationexception.php line 17: Missing required Parameters for [Route: v1.clientes.search] [URI: v1/clients/search/{name}/{situation}]. (View: C: xampp htdocs api-updater…
-
0
votes1
answer393
viewsTake a variable from the url, pass method get Laravel
How do I get this function to take the values of the url passed by method get public function searchBy($nome, $situacao){ $params['nome'] = array('value'=>'%' . $nome . '%',…
-
0
votes2
answers54
viewsDecreasing the value of two fields of a table and sorting according to the result
I have the field "killed" and "died" in the table, I need to make the order of the results come as the decrease of these two values, Example: My query is like this: $woes = DB::table('woeplayerrank…
-
0
votes1
answer153
viewsHow to configure multiple systems in a domain?
I have domain www.meusite.com.br I would like to host several systems in this domain. So: www.meusite.com.br/system1 www.meusite.com.br/system2 www.meusite.com.br/sistema3 I use virtualhost like…
-
0
votes1
answer50
viewsMount Mysql query in Laravel
Gentlemen, I have the following query in mysql SELECT DATE_FORMAT(created_at, '%Y') as 'year', DATE_FORMAT(created_at, '%m') as 'month', COUNT(id) as 'total' FROM emprestimos GROUP BY…
-
0
votes1
answer161
viewsSoapclient PHP Basic Authentication
I’m trying to connect to a web-service using Soapclient, all via it requires user and password for such connection. follows the way I am trying to connect: $wsdl = "XXXXXXXXXXXXXX?WSDL"; $options =…
-
0
votes1
answer349
viewsLaravel - Sum date from date saved in database
Good afternoon Personal, I am using Laravel, and I would like to create a method with a calculation, that from a date saved in the "dataSinistro" bank (which I will insert myself in a register) it…
-
0
votes3
answers2249
viewsError: Laravel ao Enviar email
When trying to send email in the Portuguese language I get this error message: [Swift_transportexception] Expected Response code 250 but got code "530", with message "530 5.7.1 Authentication…
-
0
votes1
answer277
viewscreation of password in the standard
Good morning to all!! How do I create a password in the style of passwords created by Windows? for very particular reasons I need to use the Laravel users table, but it is my parallel application…
-
0
votes1
answer150
viewsHow to show Laravel Storage image with Ajax?
I have a project that analyzes images and returns a frame and some variables, within the /storage/imagens/ where I save the image analyzed but I do not know how to make it be pulled by ajax and…
-
0
votes0
answers132
viewsQuery returns empty when executed in Laravel
I am running the following SQL: select * from `table` where `fields` = PointFromText("POINT(-23.559762 -46.699425)") When executed directly by the bank returns the id expected to be executed by…
-
0
votes1
answer1089
viewsValidation Can you compare 2 fields not to repeat in the database?
I need a if to check 2 values of the register and 2 of the bank, if both are equal should not occur the register. <div class="container-fluid"> <form action="adiciona" method="post" >…
-
0
votes2
answers1100
viewsHow does the Laravel Model Save method work?
Saving: var $newOs = new OS; $newOs->date = date; $newOs->name = name; $newOs->Area = area; $newOs->save(); Note that on the last line is the $newOS->save, in which no parameters are…
-
0
votes1
answer44
viewsEloquent returning JSON as variable
I have mounted the following query inside my controller: public function __construct() { $informations = Informations::get()->first(); View::share( 'informations', $informations ); } The idea is…
-
0
votes1
answer319
viewsQuery for searching with multiple tables
I need to search the data of a table of processes, and of other 2 tables one of authors and defendants of the process, the doubt is how to search in grouped form that I can go through with foreach…
-
0
votes1
answer190
viewsDoubt Join with paginate Adjustable
How to mount the following consultation with eloquent? SELECT * FROM nos.destinos d join nos.servidors s on (d.idservidor = s.idservidor) where s.servidor like '%nome%' My models class Servidor…
-
0
votes2
answers764
viewsError in path when recognizing route request
Even after the route definition, when performing a post, the application occurs the error of "404 not foud". However, in this same, when accessing the index, I can obtain data from my database.…
-
0
votes0
answers153
viewsPicture above 3000px does not load in Wideimage
Good afternoon, I have a function in which it is responsible for taking the image and resizing it, but images with 3000x2000 are not loaded by Wideimage WideImage::load($ampliada)…
-
0
votes2
answers134
viewsHow to return erased information with softdelete within a relation
There is a model in my application called payment that belongs to a user. I pull the information with Pagamento::latest()->with('user'); That way if a user is deleted, even if he already has soft…
-
0
votes1
answer180
viewsInner Join Laravel
I am trying to select data from the module table through relationship in the Standard. Where I have 2 tables Module and Activities In activity I have id_modulo and I need to select a column called…
-
0
votes1
answer26
viewsI want to pass some data on $request in a way that does the same when you send something through the form
$data = $request->all(); $data['id_cliente']= $sistemas->id_cliente; $data['id_sistema']= $sistemas->id_sistema; $data['id_versao_atual']= $sistemas->id_versao_atual;…
-
0
votes1
answer104
viewsError while updating profile photo
I was making a system auth Adjustable that changed the user’s profile photo and the following error appeared: This is my php code: <?php namespace App\Http\Controllers; use…
-
0
votes1
answer99
viewsList user messages logged in using Laravel
Good afternoon. I have in my Controller the method below: public function lista () { $mensagens = Auth::user()->mensagens()->get(); $title= "Mensagens"; return…
-
0
votes1
answer26
viewsHow do I use the explode to limit which parts of a string should appear in the view?
I’m trying to use explode to display the first name of a resume model, in a table in the view, I was initially using the method below, but it didn’t work out the way I wanted, because it only…
-
0
votes1
answer94
viewsDisable form autocomplete in Laravel?
Hi. I searched all over the Internet and couldn’t find. I just can’t get the Laravel forms autocomplete disabled. The 'autocomplete="off"' for this, does not work for the fields if email and…
-
0
votes1
answer637
viewsLaravel - Return checkbox clicked
I need to return the checkboxes clicked on a view for editing, but I’m having problems. The values even return clicked but the foreach is duplicating the checkboxes causing an option to appear more…
-
0
votes2
answers351
viewsLaravel Token Validation (Passport)
I developed an api in Laravel. It’s all right, it’s all working. The Front-End is being developed in Angular. I would like to know if there is any method provided by passport for validation of acess…
-
0
votes0
answers45
viewsHow to use two packages using Illuminate Contracts Validation Validator
In my project I have two packages LaravelLegends/pt-br-validator and nuwave/lighthouse both use the Agreement Illuminate\Contracts\Validation\Validator to validate the fields, I would like to know…
laravelasked 4 years, 7 months ago Thiago Costa 117 -
0
votes0
answers189
viewsFill in combobox via Jquery
I have the following html combobox: <div class="form-group col-lg-6 row"> {{ Form::select( 'state',array( 0 => '' ),null, array( 'class' => 'form-control', 'data-placeholder' =>…
-
0
votes0
answers48
viewsWhat are CSRF Tokens and why are they fundamental in forms?
I just started messing with Laravel and I wanted to know what it is token that is fundamental in the forms <form action="/contato" method="POST"> {{csrf_field()}}…
-
0
votes1
answer149
viewsLaravel 5 on google app engine - Error 13 Storage Bucket
I am trying to use the google app engine to run an Laravael 5 application, whenever I try to deploy the following error occurs: **Updating service [default].... ERROR: (gcloud.app.deploy) Error…
-
0
votes0
answers110
viewsRendering templates with Blade
My problem is time to render this section below: The part: @include('admin::layouts.includes.footer') stay out of the div#wrapper, someone would tell me why and how to get you inside?…
-
0
votes1
answer1753
viewsHow to create a custom Auth controller in Laravel 5.5?
I created a custom Auth controller in Laravel 5.5 with the "store" action inside it, then I authenticated using the method auth->attempt() returning true. So far so good, the problem starts when…
-
0
votes1
answer32
viewsCreate function to change a data in the database table
Good morning, I’m doing a function so I can alter a data in a database table. That is, I have 4 data recorded in my database table where the main is 'yes', when recording a fifth data, the second…
-
0
votes1
answer104
viewsLaravel - Restful API
I’m following a tutorial, for creating an application Rest in Laravel, in the second part of this tutorial Orange -Parte2, when I use the command: php artisan route:list Displays this error PHP…
-
0
votes1
answer130
viewsDoubt storageAs Laravel 5.4
I was with my local Laravel project, and I use this code to save my images: $request->profile_photo->storeAs('empresas/perfil', $filename, 'public'); Now I hosted my project, to host I needed…
-
0
votes1
answer623
viewsUndefined Function Error: Call to Undefined Function curl_init()
I am using Laravel 5.8 on a Debian Linux System with php 7.4 and implementing a function in which I need to perform a Curl: $curl = curl_init(); The code already points error when defining only the…
-
0
votes1
answer397
viewsConvert sql to query Builder - Laravel
I’m starting at Laravel and I have doubts about eloquent. Could someone help me convert that code SQL in eloquent? SELECT COUNT(d.id) as total, d.nome_disciplina FROM bd_assuntos as a INNER JOIN…