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
answer45
viewsMy index is giving a return of Undefined variable: image
I created my index so only that it is returning an error in the view to get the image : Undefined variable: image (View: /var/www/html/fernandosite/Resources/views/admin/marcadaguas/index.blade.php)…
laravelasked 5 years, 1 month ago Phelipe Queiroz 1 -
0
votes0
answers72
viewsPass variables by routes
Hello, I’m creating a website in Laravel for the first time, and is a website in 3 different languages. In partials, he owns the header, that has the option of the 3 languages, when I click on one,…
-
0
votes0
answers38
viewsI am unable to authenticate using middleware auth from the Standard
I can do normal authentication when I don’t put the routes inside a group. When I put the routes that can only be accessed with login, the page does not redirect to the administrative area. When I…
-
0
votes1
answer23
viewsLumen: I need to display two dates in a single field
I have to return a json that displays a Person object that contains Another Experience object. I’m using hasMany in Model Person and returning Json that way: $person =…
-
0
votes1
answer129
viewsInput Box centered on <td>
I’d like to know how to center inputs in the code below. @foreach ($riscos as $risco) <tr> <th class="row-header">{{ $risco->risk}}</th> @for ($i = 0; $i < 14; $i++) <td…
-
0
votes1
answer62
viewsHow do I present in a list on the same row of a groupBy table?
I’m developing a listing and I’m having a hard time presenting on the same row of the table data groupBy I’m not able to list this data on the same line, in case DT_PONTO returns two values S for…
-
0
votes1
answer95
viewsLaravel - Where in relationships?
I have a function that looks for a value of a query with WHERE in relationship : $em = \App\Elevatoria::whereHas('elevatorias_monitoramento', function(Builder $query) {…
-
0
votes1
answer137
viewsProblem with Route and IF in Laravel 5.8
I have a Route that passes 2 parameters, and can be optional. In the view, If you click on Link 1 (you pass the 2 id’s) I want you to check certain options. If you click on Link 2 (you will pass…
-
0
votes2
answers1881
viewsLaravel - Passing Variable To View - Record Page
I’m using Laravel 5.8 and added an extra field in the user register. I want to insert a form select in this field but, I’m having difficulty. What I thought I could do, was this in the file…
-
0
votes1
answer1284
viewsHow to take a value from a select (Edit) Laravel
good morning, someone can help me in this select, (example: User will register and there he selects the customer already registered). then you will have the inputs to fill but select, OK! now it…
laravelasked 5 years, 1 month ago user160990 -
0
votes1
answer46
viewsInsert returns TRUE, but does not insert
I’m learning Laravel 6 and I made a registration form (I’m not using Laravel’s auth) and when I send the data and perform the Insert in the table it returns TRUE, but when I check in the Database it…
-
0
votes1
answer155
viewsSOLID Principles within Laravel Controller
Within SOLID principles, how to implement the first 2 principles ? SRP and Open-Closed Principle. My structure is simple, it has models within the app generated by Artisan, and simple controllers.…
-
0
votes0
answers239
viewsBlade directives (Laravel 5.6) inside the Vue.js slot element
I created a Blade directive called @permissao which simply checks whether a certain value exists in the user’s session, in order to show or hide a link from the menu. The menu I created as a…
-
0
votes1
answer650
viewsConsultation with eloquent relationship
I am hitting myself here with a simple query on Laravel, I want to make a query on the client table and bring the customer’s address together. Note: Whenever I try it brings the address id and not…
-
0
votes0
answers32
viewsRelating Type and Subtype
What can I call a Subtipo searching for the tipo_id, I did some tests here but none successfully this is my first project. Table of the Type public $timestamps = true; protected $table = 'tipo';…
-
0
votes1
answer490
viewsCatch a certain amount on a Foreach on the Blade
I wanted to know how I do to walk through a Collection and result a certain value? The Collection works like this and returned various values of employee appointments to be printed on the point,…
-
0
votes1
answer80
viewsAJAX files post returning null
I have following HTML: <meta name="csrf-token" content="{{ csrf_token() }}" /> <form action="{{route('clinic.picture.add.ajax')}}" method="post" enctype="multipart/form-data"…
-
0
votes2
answers316
viewsHow to access the React upload Enable in the Laravel API?
I have an app in React on, I have an option that the user can change his avatar, I am using the library ImagePicker and I have the API in Laravel. I’m having trouble accessing the chosen image in…
-
0
votes1
answer151
viewsuse redirect to specific page after validation in case of error - Laravel
Well I have the code below Validation: class FormNew extends FormRequest{ public function authorize() { return true; } public function rules() { return [ 'email' => 'required|email', ]; } public…
-
0
votes1
answer401
viewsFile Path in project
I have a project where I need to develop a billing request, I am implementing a spreadsheet import for DB Mysql, until this part is OK, the problem is that I can’t find the file inside the folder…
-
0
votes0
answers136
viewsScripts js Bootstrap in Laravel
Good afternoon I am studying and developing a project with Laravel Framework but I came across a Front-end problem at the time I was using Bootstrap. I create the link to my script no more js…
-
0
votes1
answer818
viewsGet ID of the NAME parameter passed on the route with Laravel
I have a route that has parameters: Route::get('/cursos/{area?}/{categoria?}', 'SiteController@cursosFiltro')->name('cursos'); In the URL to passing the Slug of these past terms: {{…
laravelasked 4 years, 11 months ago Junio Araujo 91 -
0
votes1
answer236
viewsProblems with the vendor/bin folder of an Laravel application
I’m trying to deploy a standard application to both AWS(Amazon Web Services) and Heroku, and both have reported phpunit errors inside the vendor folder. After several searches (which already cost me…
-
0
votes1
answer216
viewsPDF being generated with blank sheets
I have an API in Laravel that has an end-point (POST method) to generate PDF (Dompdf) with the following method: public function generatePDF() { return…
-
0
votes0
answers48
viewsAllow external connection to the database
Guys I have a problem accessing a database that is in a Virtual Machine. I have a machine A that has an application Laravel all configured and the project installed, and has another machine B where…
-
0
votes2
answers192
viewsPrint Database Data with FOR in Laravel
I am a beginner in the framework Laravel, in which I have a doubt, when printing database records for an html table, in all the examples I saw was used the foreach, I have also used.…
-
0
votes2
answers236
viewsProblem To View Data Json View Blade
Hello! I’ve tried several times and I’m having difficulty visualizing the data of a Json in a View. I’m passing this data like this in Controller: $validatorES = new EntradaSaidaFormRequest();…
-
0
votes1
answer374
viewsValidation error in Laravel update
Follows the code: public function update(Request $request, Contact $contact) { $validator = Validator::make($request->all(), [ 'name' => 'required|min:6|max:255', 'email' =>…
-
0
votes3
answers1368
viewsGet Laravel login user address
I have a project on Laravel 6 and I can get the username logged in: {{ Auth::user()->nome }} It turns out that this user’s address is in another Onetoone table where 1 user has 1 address. How do…
-
0
votes1
answer139
viewsRun Artisan Migrate in dynamic banks
Hail, hail people! I have a problem in a project with multiple databases, each database corresponds to a user that is created when the user confirms their registration. I created a specific command…
-
0
votes1
answer122
viewsSingle modal for lines of a DATA TABLE
I have a data listing with approximately 1200 clients where I bring [CPF, NAME, PHONE, ONE STATUS] and a column with the control buttons, a year ago I took a mini-course in college to learn how to…
-
0
votes1
answer175
viewsQueue Laravel with Multitenancy
Boas Galera! I have a multi database application where every schema is a client, everything works perfectly, except the queues. I am directing all Jobs to the main database, Jobs records are…
-
0
votes1
answer137
viewsLaravel with fully separate code
I’ve been programming with PHP for some time now, and I’ve always done my projects at hand (without using framework like Laravel, zend, etc.), making a structure very similar to mvc. However I want…
-
0
votes1
answer127
viewsJquery event . change running when loading the page?
I have a Jquery responsible for popular a select based on the value of another select, solved the issue successfully using the following code: $("#tipoProcedimento").change(function(){…
-
0
votes1
answer56
viewsLaravel API Guzzle recording data in the database with array -> HOW TO DO?
Hello, I have an API that consumes external information and needs to record the resulting data in the database, but is returning data in an array. I need a help to record the data, I appreciate the…
-
0
votes0
answers494
viewsError in Poser when performing dumpautoload
I’m using Laravel 5.7 and when I execute the command composer dumpautoload -o I get the following error from commiserate: [Runtimeexception] File at…
-
0
votes1
answer337
viewsI cannot authenticate to the Laravel api using Sanctum
I am using the Standard Sanctum to generate access tokens for my api. I have followed the step-by-step documentation of the Standard. I generated a token. But when I go to access a route that…
-
0
votes1
answer273
viewsWordpress and Laravel in same server and same domain
I have a Wordpress configured in a root folder on the server and created a subfolder with a Laravel, WP works normally, but Laravel opens only index, when I try to open the routes open a WP error…
-
0
votes1
answer133
viewsHow to treat an sql command in the Laravel controller?
Good night, you guys. I followed the dompdf tutorial successfully for static texts, now I wanted to make a query in the database to print the results in tables in a pdf and I get this error:…
-
0
votes1
answer496
viewsDynamically add Vuejs/Laravel inputs
I’m learning how to work with Vue.js, and I need something relatively simple but I couldn’t solve, generate inputs dynamically in a form. Basically the form already comes with an input, and whenever…
-
0
votes1
answer69
viewsHiding ( $Hidden ) password Laravel 7
I need to hide the password to be seen or etc either in the bucket or whatever form, because I list the users in an administration pad, even using the Model with Hidden as below I can read the…
-
0
votes1
answer39
viewsPass Select sql to the default used in Laravel
In my phpMyAdmin, I use the SQL below: select categorias.id as categoria_id, nome as categoria_nome, count(*) as Quantidade from `livros` inner join `categorias` on `livros`.`categoria_id` =…
-
0
votes1
answer103
viewsCustomization of Laravel Validator message
I have the following validator cpfValidacao.php: <?php namespace App\Utils; class cpfValidacao { public function validate($attribute, $value, $parameters, $validator) { return…
laravelasked 4 years, 6 months ago Luiz Roberto Furtuna 593 -
0
votes1
answer63
viewsHow to use Custom Request in Controller
Follows my AuthRequest.php: <?php namespace App\Http\Requests; use Illuminate\Http\Request; use App\Rules\CpfValidacao; class AuthRequest extends Request { /** * Get the validation rules that…
laravelasked 4 years, 6 months ago Luiz Roberto Furtuna 593 -
0
votes1
answer91
viewsLaravel 7, use of Foreign key
Good morning, I am doing a small project in Laravel 7 and it is the first time that I use Foreign Key and relate two Database tables. In both Models of the respective tables I have already put a…
-
0
votes1
answer49
viewsPass php variable in javascript function
Could you help me with a question? I need to pass PHP variable values to a Javascript function (Laravel). //+5% $tv90 = number_format($tv90 + ($tv90/100*5), 2, '.', ''); $tv125 =…
-
0
votes2
answers172
viewsForeach in Laravel only returns the first line
I got Following code down on Laravel 7 My controller is taking the many relationship to one as per the model below: public function listarPermissoes() { return $this->hasMany(Acoes::class,…
-
0
votes2
answers63
viewsLaravel: redirect after logging in
Hey, guys, what’s up? I’m sending an email to the customer like this: @component('mail::button', ['url' => env('APP_URL') .'/SobeDocsFiadorCadastrado/'. $fiador->id ]) Clique para iniciar…
-
0
votes1
answer38
viewsHow to use the Clickable guzzle to redirect a file download of a request
I need your help to find a way to be a 'proxy' between the frontend and a third-party software component using Laravel. Third-party software is on my company’s network and generates the files on…
-
0
votes1
answer26
viewsCall to Undefined Function storeExcelView() using Maatwebsite
I have the following problem, I’m getting this message: Call to Undefined Function App Jobs Pit Reports Placar storeExcelView() Detail: I am using PHP 7.2 and Laravel 6. The same code in PHP 5.6 and…