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
votes2
answers72
viewsDoubt regarding the Task Schedule- Laravel events
I have searched the documentation and other forums, but I did not find the answer. Next, how often does a task start normally at what point? I know the method ->hourly() is executed every hour,…
-
0
votes2
answers429
viewsClasses of validation Laravel
Good morning!! Use for a long time some validation classes (CPF, e-mail, CNPJ) at the moment I’m starting to migrate to Aravel there arose the doubt. Where I put these validation classes? What do…
-
0
votes1
answer66
viewsRun Artisan within linux shell script
How do I shell a linux script to run an Artisan command from Laravel? ex: php artisan migrate but create a script to run this command
-
0
votes1
answer34
viewsHow to resolve this error in Laravel
I’m developing a project and I caught this mistake by picking up a new version of it on github, after starting the server cannot run the application, this error appears: No Application Encryption…
-
0
votes1
answer35
viewsHow do I get a user id from the creation of a Validator in Laravel?
public function boot() { //Criação de uma nova validação \Validator::extend('unique_cpf', function ($attribute, $value, $parameters, $validator) { $value = str_replace(['.','-'],'', $value); return…
-
0
votes1
answer34
viewsJavascript snippet does not work
I don’t know what I’m doing wrong, maybe I can even be simple, but it doesn’t give me the expected result When creating the html component: <li class="dropdown notifications-menu"> <a…
-
0
votes0
answers1665
views -
0
votes1
answer122
viewsIndex column in datatables
When I did not load the data dynamically into the table I used this way to create the index column: https://datatables.net/examples/api/counter_columns.html t.on( 'order.dt search.dt', function () {…
-
0
votes0
answers118
viewsProblem with Storage
I currently own the following tree in my dreamhost hosting [Core do laravel] - laracore -- app -- bootstrap -- config ... [Pasta public fora do core] - exemplo.com.br --css --js After adjusting the…
laravelasked 5 years, 9 months ago Ronnie G. Chagas 1 -
0
votes2
answers40
viewsSum result of Count, is it possible?
I need to add the result of a count() in a table and the function sum() does not work for results obtained with count(). This is inside a foreach:…
-
0
votes0
answers127
viewsWhat is the right way to pass variables to the Create Laravel page
I’m making my TCC and I have a pre-registration page, where information like [nome, email, senha, token] and she saved on the table pre_register. Then a email for the person with a link, it contains…
-
0
votes1
answer609
viewsConvert SQL query to Query Builder (Orange)
I would like to convert the following query SQL to Query Builder (Laravel): $duels = DB::select('SELECT r.id, r.name FROM tournaments t INNER JOIN duels d ON t.id = d.tournament_id INNER JOIN riders…
-
0
votes3
answers236
viewsJob scheduling and publishing
good afternoon! I’m trying to build a publishing scheduling system. I have a table where are stored the date/time that the post should be published, when the scheduled date is equal to the current…
-
0
votes1
answer3200
viewsCreating a message of success when able to perform an action LARAVEL 5.4
I’m trying to get you informed a message of success in a div when an action is carried out, however I could not yet, the error that appears is: (3/3) Errorexception Undefined variable: sucess (View:…
-
0
votes0
answers63
viewsReflectionexception Laravel 5.7 instance Gcloud
I have deployed my application to a Gcloud instance and cannot access a specific page where I import files. Controller <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use…
-
0
votes1
answer138
viewsHow to maintain filters after paginate and Submit
I have created a filter screen and paginate of the Laravel. The filters are all working, but I need that after I go to page 2, continue the filters I put. And when I put the filters in, they’re…
-
0
votes1
answer86
viewsHow to pick the difference in time between two dates using the Carbon plugin, where it shows me whether it is positive or negative
Example: $primeiraData = Carbon::parse('2019-02-01 13:00:00'); $segundaData = Carbon::parse('2019-02-02 14:00:00'); $resultado = $segundaData->diffInHours($primeiraData); Regardless of the order…
-
0
votes1
answer44
viewsMany zeros in the modal
I created a test modal in an attempt to return the id value to the view and as there are more than 5000 records in the query, I don’t know what happens.. but prints a million zeros in the modal,…
-
0
votes1
answer446
viewsInstantiate class in method parameter or within method
Working with an Laravel controller I came across something similar to this: public function show(Role $role) { // é apenas um exemplo. } Where the Role class is instantiated in the variable $role…
-
0
votes1
answer614
viewsUpdate quantity in dynamic table with Ajax
I have a shopping cart that modifies the quantity through ajax by functions remove and adiciona. I have the function atualizaQtd that by ajax returns the current amount. How could you insert this…
-
0
votes0
answers449
viewsLaravel Expired Page, why?
I’m creating a Rest api here, for some reason I get this message "The page has expired due to inactivity. Please refresh and try again." Segue Controller <?php namespace App\Http\Controllers; use…
-
0
votes0
answers61
viewsConvert string to path
I would like to save the route in the database. So I saved it like this. Example: Route table | id | rota | | 1 | route( 'login' ) Then I would like to recover and use as route even in Laravel, in…
-
0
votes1
answer295
viewsUse the one parameter in other pages with Laravel?
I’m doing an app on Laravel 5.4 that the administrator modifies various information of a particular client. Example: in the customer listing is clicked on Modules The user is directing to another…
-
0
votes1
answer1284
viewsSending data to Controller via Ajax Laravel
I have a project in which I have to send a patient’s CPF to a method in the controller in order to do a search within this method and already return the value of the search to the view , however I…
-
0
votes0
answers170
viewsError in Laravel 5.7 validation messages
I am working with Laravel validation messages, but always this returning me "validation.min.string", I stopped importing something? Controller $this->validate($request, [ 'telefone' =>…
-
0
votes0
answers173
viewsError trying to send bulk email
I have a system in Lockable and in it is carried out mass mail shoots constantly. I use the SMTP Locaweb to send. I’m just having a lot of mistakes of the same kind. Swift_TransportException:…
-
0
votes1
answer604
viewsAdd to cart with Ajax without updating page - Laravel
Hello, I’m trying to use Ajax in a form to add products in the cart without updating the page but I’m not getting, if anyone can help me. I’m wearing Laravel 5.3 joint on this website: HTML <form…
-
0
votes1
answer74
viewsUpdate on some Laravel 4.2 fields
I have a table called People in Mysql with 40 fields and I want to update only 2 fields (latitude and longitude) but I don’t want to bring all 40 fields to change together. I just want to save the…
-
0
votes1
answer97
viewsCapture Resource route id Checkbox with extra parameter
I have the following route of type Resource: Route::group(['prefix' => 'processos' ,'namespace' => 'Processos', 'middleware' => 'processo_exists'], function () { // Andamentos…
-
0
votes0
answers42
viewsMYSQL does not list when running the command 'netstat -ntlp'
Apparently my MYSQL is working normal, but when I run the command: netstat -ntlp The result is this: As if MYSQL is not running.…
-
0
votes1
answer1114
viewsLaravel with error in Composer install
I moved the Laravel to the homologation server and when I ran the Composer install, I had this problem. Has anyone ever had anything like this? on my machine that rotates under the flat wheel…
-
0
votes0
answers131
viewsUpdate record with image - Laravel
Good afternoon! I have a problem with the controller update method. By invoking the update, instead of updating the record, the log is creating a new one. This way I get two similar records.…
-
0
votes1
answer551
viewsHow to recover image from Storage folder using INTERVENTION IMAGE Laravel 5.2?
This solution works in Public more folder when switching to Storage folder I can’t grab the image and display in the view someone can help me? Controller public function profile(){ return…
-
0
votes1
answer278
viewsDocker Laravel Map folder
Good afternoon. I’m trying to create a development environment with sublime, Docker, Portable. The image that I downloaded from the Docker hub, comes with debian, php, already isontalized Laravel.…
-
0
votes1
answer1095
viewsSwift_transportexception error when sending e-amil using SMTP + Laravel 5.4
Speak Person, one more trouble, it’s as follows: I am trying to send an email through my application (api), where I develop with Laravel 5.4. The thing seems very easy, just not! My file . env is as…
-
0
votes1
answer155
viewsTransform Mysql query into Eloquent (Laravel)
I have a simple query on MySQL, the query lists all the data of a table making a Group By in the field grupo_id and listing the latest data from Group By based on the created_at. In short, he lists…
-
0
votes0
answers328
viewsLaravel 5.7 - How do I end the session if the user closes the tab or goes back to the login screen?
Told me to use Session::flush(); in the loginController, however, it is not killing the session.
laravelasked 5 years, 7 months ago user9078159 5 -
0
votes0
answers90
viewsHow do I record the data from a form in the database in Laravel 5.4?
I have a small problem in the production of a registration system, everything is working fine, but when I check the database no data submitted in the form appears, ie is not registered. Class in the…
-
0
votes0
answers962
viewsLaravel "Malformed UTF-8 characters"
I’m using Laravel in version 5.4 (PHP 5.6) to develop an API. Recently, when the API was published in Umbler (Linux), when trying to access endpoints that return strings with special characters…
-
0
votes1
answer442
viewsAxios or Ajax in Vue.js to perform requests to the server How can I api?
I have a question I couldn’t solve by searching the Internet. I use ajax to perform requests for a long time, now I’m programming in Vue.js, and I use Xios, I wonder if there is any difference…
-
0
votes1
answer332
viewsHow to access a class that is inside a folder in the Laravel vendor?
I can’t access Spreadsheet class, it appears: use Illuminate\Database\Eloquent\Model; use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; class Excel extends Model {…
-
0
votes0
answers582
viewsDisplay a file that is in the Storage folder -- Orange 5.2
I have a problem with my code. I can normally insert the file into the Storage folder $pathfile = $this->path_monografia . $monografia->id . DIRECTORY_SEPARATOR . "monografia.pdf";…
-
0
votes1
answer154
viewsCustom Request does not redirect Laravel 5.4
I am implementing a system and realized the creation of a request through the command: php artisan make:request PreventivaRequest I put my rules in Request: <?php namespace…
-
0
votes1
answer245
viewsHow to delete an image from Storage Folder 5.2?
I’m using this code to upload image this all working my doubt and in the if condition to delete the old image I have to leave a default image.jpg as default plus my condition if this deleting that…
-
0
votes1
answer129
viewsHow to set up Laravel Sending Driver with Dynamic Sender
MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 [email protected] MAIL_PASSWORD=Senha123 MAIL_ENCRYPTION=tls How to leave [email protected] and MAIL_PASSWORD=Senha123…
-
0
votes1
answer144
viewsLaravel route accessible by two types of user
I have an application where I have two authenticated user types (common and administrator). I have a route where I pass the id of the state and return me a json with the cities of that state. It…
-
0
votes1
answer387
viewsWhat’s the real difference and when to use Chunk() and chunkById() from the Laravel
It wasn’t very clear to me how the documentation works and I couldn’t find any content to fully explain how to use chunkById() and the difference practices for Chunk(); How do I return the result of…
-
0
votes1
answer66
viewsI’m having a problem where I really don’t know how to do an event that hears an action on the Laravel
I have a slide show of images where the images registered in the database appear. The table is called events. In this table there is a field called end date, which would refer to the end of the…
-
0
votes0
answers119
viewsLaravel, Validator with multiple Fields and {{old}}
I have this code with $n form Fields. I’m not getting to use Validator;{ public function salvar() { $n =Request::input('campos'); for($i=1; $i < $n; $i++){ $pontosa =Request::input('pontosa'.$i);…
-
0
votes1
answer122
viewsDownload Laravel dependencies via Composer in AWS EC2
I cloned an Laravel project on a linux server EC2 and when I will download the dependencies via Build it gives the error Do not run Composer as root/super user! See https://getcomposer.org/root for…