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
answer164
viewsHow do I receive the key of an array in the controller in a variable?
I’m sending a parameter in a view href="{{route('products.index', 'E')}}" I need to receive this parameter 'E' in a variable in the controller and send via compact(); in another view follow my…
-
0
votes1
answer249
viewsHow to change the value of an input type text to a date format in Laravel
The problem is that the input type text is sending the date value to the Mysql Database in the following format DD/MM/YYYY, but Mysql only accepts a text for the date format if it is in the…
laravelasked 5 years, 3 months ago Calebe Pereira 29 -
0
votes1
answer92
viewsTernary Laravel Relationship
I’m creating a polling system where I have the following tables. A poll has several options. An option belongs only to a poll. A user can vote in multiple polls, but one option per poll. Soon I made…
-
0
votes1
answer985
viewsIs it correct to use redirect route on the Laravel to make the change in the page’s Russian language?
In case when logging in with Return view, it loads the home view above the /login url: public function logon(Request $request){ $dados = $request->all(); $usuario = Usuario::where('email',…
-
0
votes1
answer29
viewsCreate in table related to another table does not work
I’m having trouble inserting into two related tables, the Peoples and Addresses tables. Insertion is being done only in the Peoples table. The relation in the Addresses table is made between the…
-
0
votes1
answer29
viewshow to filter data from a table
I have a table estagiario related to a table areas, and the table areas in turn this related to the table departamento. I can even list all the interns used the following function: public function…
laravelasked 5 years, 3 months ago Albino Mateve 1 -
0
votes2
answers420
viewsCreate a PHP Array with values from months past the year Using the Carbon API
I need to create a chart of reports from the beginning of the year to the present day. And my idea is to use a line chart that shows each month the value of a report defined by myself. Example: in…
-
0
votes1
answer73
viewsProblem when using query
I’m having the following problem when using some query in my Laravel. I wondered this IP 192.168.1.1, in my file . env put 192.168.1.31 where is located my database. Does anyone know what might be…
-
0
votes0
answers73
viewsCorrect Variable Statement in Document.getElementById() to @foreach
Hello, I need to call a script inside a page triggered by a button using ajax method. My script in Javascript: <script type="text/javascript"> function attachProjetoFuncionario() { var…
-
0
votes1
answer335
viewsHow to insert multiple data at once into the database coming from multiple inputs with the same name?
I am generating lines through javascript for the user to register several information at once in the table. When I send the request, the database only records a record and needs it to take all the…
-
0
votes1
answer211
viewsHow to use foreach to display various array values for the view in a table
I’m having a question so I can use one array of PHP to display the values within a table. The principle is to store the values in a array and then use a foreach to insert the values within a table…
-
0
votes1
answer45
viewsQuery SQL returns data that was not to be returned
Well, I’m putting together a ticket sales system for football matches as a project of my course I’m working with the Laravel + Eloquent ORM, but I’m having an inconsistency. My code is: $matches =…
-
0
votes1
answer124
viewsPossible redirect function without route on Laravel?
I’m using a feature to generate PDF reports using Laravel. However I am in doubt if it is possible from a simple HTML button, to redirect automatically to a function of mine controller without…
-
0
votes0
answers23
viewsBonus for better performance in massively updated records search using a secondary table with Laravel
I am using the Laravel framework in a project and in it there is the model Product. On this system, I also have an API where one of the endpoints gets a date and should return the changed or removed…
-
0
votes2
answers67
viewsHow to format date field in datatables?
current code return datatables()->of($query->get()) ->addColumn('action', function($data){ $button = '<button type="button" name="edit" id="'.$data->id.'" class="edit btn btn-primary…
laravelasked 5 years, 3 months ago André Cabral 811 -
0
votes2
answers110
viewsHow to update a table with an array in the Laravel?
CONTROLLER CODE $form_data = array( 'numdoc' => $request->numdoc, 'data_emissao' => $date_emissao, 'data_debito' => $date_debito, 'cliente_id' => $request->cliente_id, 'devedor_id'…
-
0
votes1
answer62
viewsError calling table item in Laravel
I have a View in the Laravel that shows the access key and the secret key of the api user, these two keys are pulled from the database to the View, i want to be able to edit only the access key when…
-
0
votes2
answers242
viewsHow to instantiate one model inside the other in the view?
Error: Property [id] does not exist on this Collection instance. MIGRATION DIVIDE <?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use…
-
0
votes1
answer178
viewsMigrations Laravel 5.8
A mistake is happening when I’m going to make Migration one for many. The goal is to make a customer will have many phones and a phone will belong only to one customer. In the code below you can see…
-
0
votes1
answer441
viewsUser mock for testing in Laravel/Phpunit
I have a legacy application in Laravel where users can see or not certain system module according to their permissions. These permissions are saved to the database in N:N form and managed in…
-
0
votes0
answers57
viewsLaravel - Save div image to file?
I need to assemble a form (blade) where I glue an image, I use javascript and it works without problems, but when I try to recover this image in controller, the data are not passed. In the HTML am…
laravelasked 5 years, 3 months ago Reinaldo M. Okano 1 -
0
votes2
answers78
viewsFactory of Relation N:N
I am with an application where users can see or not certain system module according to their permissions. These permissions are saved to the database in a way N:N and managed in UserPolicy, as an…
-
0
votes1
answer124
viewsWhat is after "php Artisan serves" in Laravel?
I am in doubt of exactly what happened. I found this error in the system I am developing. When I start my server in Laravel appears a supposed "=" after using the php artisan serve. This same "="…
-
0
votes2
answers145
viewsProblem with table data insertion via Aravel
I have a project in Laravel at the same time I learn to use the framework, I need to insert a certain value in a table field, for this there is a condition I put in the controller: public function…
-
0
votes4
answers274
viewsI’m not able to create the relationship between the tables through the migrations of Laravel
I am using the Multi Tenancy in Laravel, so I created the Migrations, without relationship between table was working normal, when I related that started the error. I thought it was the execution…
-
0
votes1
answer1590
viewsERROR: POST.... 500 (Internal Server Error) - LARAVEL and AJAX
I am facing a problem when returning a View to another View using Ajax. I am presented with the following error on the Google Chrome console: jquery.min.js:2 POST http://localhost:8000/tbody 500…
-
0
votes1
answer224
viewsHow to prevent a user from accessing another user’s ID when editing a post by making improper changes?
I was looking for a way that the logged-in user could not access another post when editing, just changing the id on url and implemented something like this, where it will be added to Controller that…
-
0
votes1
answer31
viewsLaravel - Controller Return view->width does not pass data to the view
My view does not have the data sent by the user Controller $posts = Models::post()->with('user') ->where('chatter_discussion_id', '=', $discussion->id) ->orderBy('created_at', 'ASC')…
-
0
votes1
answer78
views -
0
votes1
answer119
viewsTrouble recovering id after search with Laravel
Good morning everyone, I’m having a little problem here on a search of the Laravel, I’ve thought of several things but I couldn’t solve. I have a table rendered in a view and some buttons in this…
-
0
votes0
answers166
viewsAccessing User Panel via Admin, Laravel 5.8
I need to access the user panel listed by the administrative panel in Laravel. I am copying from another project that is 100%. However in mine does not work. my html: @foreach ($users as $row)…
-
0
votes0
answers35
viewsBad Request reponse Guzzle para Google Storage no Laravel
Good morning, I’m having a problem sending a file to Google Storage it returns me the following error: Client error: SETURI http://dev-site.com.br/storage resulted in a 400 Bad Request sponse My…
-
0
votes2
answers198
viewsLaravel Authorization for Multi Authentication
I have an ACL app for Laravel where I have two sessions(Guards), one for users and another to admins. The configuration of Guards auth.php file looks like this: 'guards' => [ 'web' => […
-
0
votes1
answer148
viewsPDF attached in encrypted email arrives
I am attaching a PDF to send in the email, using Laravel and DOMPDF but when the email arrives, there is no PDF attachment, it arrives encoded in the body of the email. follows the code. Remembering…
-
0
votes0
answers60
viewsHow to use 2 updates function in Usercontroller in Laravel
I’m trying to add an image of the user profile and also the btc wallet in an input. If I add the wallet I can’t add the profile image. I saw that the two use the update function and so I’m having…
-
0
votes1
answer105
viewsHow does Password Grant Tokens work on Windows?
I want to develop an application to consume a Rest api and I want to add API KEY to validate the communication between the client application and the service (cross-device validation), application…
-
0
votes1
answer207
viewsProblems logging in with Vue, Vuex, Xios and Laravel
I’m trying to log in an application that uses the Windows as back/api and the front with Vue/vuex/Vue-router, but when receiving the token I can’t keep the status in the store after updating the…
-
0
votes2
answers167
viewsEloquent: Relationship (JSON) -> Hasmany and Belongsto
Say guys all right? Next, I have a little problem related to two models within my project. First Model I have a relationship hasOne: <?php namespace App; use Illuminate\Database\Eloquent\Model;…
-
0
votes1
answer458
viewsSOLID no Laravel
Laravel breaks the concepts of SOLID? SRP - Single Liability Principle Unique - A class must have one, and only one, reason to change. OCP - Open/closed principle Open/closed principle - You must be…
-
0
votes1
answer95
viewsLaravel - relationship 1 for two tables and sort
I have a playlist table, a playlist_content table and two Vodcontent and Livecontent tables. Today I make the relationship between vodcontent and livecontent with a hasManyThrough relationship.…
-
0
votes1
answer119
viewsError with Passport plug in Heroku
I have deployed an application to Heroku and am getting the following error "message": "Key path "file://app/Storage/oauth-private.key " does not exist or is not readable", "Exception":…
-
0
votes0
answers46
viewsRecursion Return
I’m trying to create an application where I put source, destination and cost data into an array and the user must enter the source and destination so that the system can then scan that array and…
-
0
votes1
answer1607
viewsUndefined Property: stdClass
I have a question regarding an array. I have the following information: What I’m not getting is to go through the other array. Below is the code. foreach ($file_contents->retorno->contatos as…
-
0
votes2
answers409
viewsSend JSON with python to API
I’m putting together a list of objects to post to an API in made in Arabic, but I can’t convert the data to work on the API. In python the list of objects is something like: payload = […
-
0
votes1
answer482
viewsLaravel - How to override the validation message?
I have a Request that validates through a class Request: The Controller: public function store(PagtoRequest $request) { ... resto da lógica A Request: namespace App\Http\Requests; use…
-
0
votes1
answer115
viewsHow to make an auto complete in the Standard
<input class="typeahead form-control" style="margin:0px auto;width:200px;" type="text"> </div> <script type="text/javascript"> var path =…
-
0
votes1
answer909
viewsPersonalized messages with Validator
I can’t apply custom rules to my forms, every time I try to apply some rule, it returns a ValidationException pattern of Laravel, how would you make the error message to be customized? <?php…
-
0
votes1
answer275
viewsHow to treat exceptions when deleting a primary key record referenced in another table in the Laravel framework
I’m having trouble deleting a record to which your primary key was referenced in another record from another table! The tables are discipline and teacher, where the primary key of teacher is being…
-
0
votes1
answer31
viewsField Autocomplete Error - Laravel
I’m having trouble implementing a autocomplete field, I’m used Laravel 5.9 and Bootstrap Typeahead JS. Follows code: Route: Route::get('buscarservicos',…
-
0
votes1
answer1055
viewsDelete data with regards Many to Many in Laravel
I’m having a problem deleting associated data in Laravel. I have user tables, records and tags. As you can see the table users connects with records, while a pivot table (registro_has_tags) connects…