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
-
1
votes1
answer263
viewsQuery "or" and "and" in Laravel
Could someone help me? I need to do this query on the Laravel: SELECT * FROM materiais where material like '%caneta%' or localização like '%armario%' or fornecedor like '%kalunga%' and setor =…
-
1
votes1
answer418
viewsThe file name Laravel
I’m saving a file on Amazon’s AWS S3, the file is being saved but it puts an underline and a number in front, as shown below: And this is in the way of getting the URL of the PDF to show the PDF to…
-
1
votes1
answer628
viewsReact Axios PUT/PATCH method Unauthorized, Laravel 5.7
The PUT/PATCH methods available in the API via the function Route::apiResource('user','UserController'); are those: GET and POST requests work normally, but in the PUT/PATCH route implementation I…
-
1
votes1
answer74
viewsSet colors in Google Geochart Laravel?
I’m trying to define the colors of the Brazilian states, which are coming from mysql via json the information, but I’m not having resulted in the return of colors. Ex.: São Paulo in color Blue -…
-
1
votes2
answers580
viewsLaravel - Select in multiple tables
My goal in the code is: - Create a filter option for the customer, where he will have the options to filter the product by: COLOR, GROUP, FEATURE AND MEASURES. My problem is: - Create the query that…
-
1
votes1
answer51
viewsHow to mark checkbox with a single color?
Hello, I have the following problem: When entering the edition of my product I need that in the part where you have the images of the products, each product has its specific color. Ex: But he is…
-
1
votes2
answers658
viewsHow to insert an array in a column of the Postgres array type with Laravel/Eloquent?
I have a column like Postgres array and I’m trying to insert an array into it with Eloquent, only it’s giving me a wrong saying that the column is badly formed. My model is like this: class Leituras…
-
1
votes1
answer248
viewsLaravel 5.1 access cookie generated in middleware before being redirected to view
In my application I have an authentication system with token_ and refreshtoken_ and I have a middleware to verify that the user is logged in and to renew their token_ if it is expired. After I renew…
-
1
votes2
answers594
viewsComparison of datetime using Laravel eloquent
Hello, I’m having problems using Laravel’s eloquent to create an SQL that meets the following demand: "return a query if there is a reservation made in a certain period of time"; Following the code…
-
1
votes0
answers35
viewsDoubt Code (Charset) Soapclient Laravel
I would like to understand the reason for this difference in a consultation using the SOAP: In an application the SOAP query returns a string in format ASCII, with special characters of shape of ??…
-
1
votes0
answers56
viewsErrorexception: unserialize(): Error at offset 0 of 9947 bytes in file in Laravel
I’m having this error in the Standard when trying to fetch data from my database: Errorexception: unserialize(): Error at offset 0 of 9947 bytes in file Controller: public function show(Request…
-
1
votes1
answer59
viewsLaravel Seed, relating models from a JSON
I’m doing a Seed from a Json file, I can read and populate the data, but at the time of linking the relationship between Dealership and Brands I can’t. How would I do that? With the $filename =…
-
1
votes1
answer990
viewsLaravel Combobox Autocomplete Select2 JS
Can you help me? I have the code further down working perfectly. But when I put inside a modal, I can’t write inside the text field. VIEW <select class="itemName form-control"…
javascript laravel twitter-bootstrap self-cmplete jquery-select2asked 5 years, 8 months ago ShBr 139 -
1
votes1
answer448
viewsCors error in the Laravel when using middleware jwt.auth
When I try to make an http request inside my jwt.auth middleware I receive: :9000/#/Dash/typeproducts:1 Access to Xmlhttprequest at 'https://api2.jcontrole.com.br/api/notificacoes/gerais' from…
-
1
votes1
answer152
viewsView related table information - Laravel?
I’m starting to mess with Laravel(5.7) and I’m having a little trouble. I have two tables, product and category, being that one category can be of various products, and the product only of one…
-
1
votes1
answer734
viewsLaravel - How to pick, manipulate and change Lengthawarepaginator items
Good night, I need to take the database data and make a certain change in the return using php before returning the data. I will not paste the real example, because it is very complex and would end…
-
1
votes0
answers34
viewsAngular 6 with broken Laravel/Lumen JSON
Guys I’m sending an angular post to a Windows/Internet application, but my JSON arrives broken. Now when I send by Postman, it arrives this way. follows my Angular code cadastrar(register:…
-
1
votes2
answers527
viewsFill in input according to other input response
Good afternoon, I have the following code in my locker: <div class="form-group col-sm-6"> <label class="control-label">{{ trans('app.select_client')}} <span…
-
1
votes1
answer257
viewsValidations with Laravel - Input and Option
I have a form that I receive an email address and what type of email. Filling in the fields should not be mandatory. If the email is completed, please provide the type. Following example: Email -…
-
1
votes1
answer205
viewsIntermediate relationship between two Laravel tables
Good evening I have the following tables in my application. Doacao -id -nome -doador_id Instituicao -id -nome Doador -id -nome I need to carry out the relationship, in a third table among the…
-
1
votes1
answer130
viewsRemove empty Request values from the form
I need to remove the values that from the first input are empty. $count = count($request->item); for($i=0; $i < $count; $i++) { if ($request->item[$i] === null) {…
-
1
votes1
answer290
viewsWould the Docker in Laravel be the same as the Laragon?
Guys I’m having a doubt, I’m a beginner in Laravel I’m using Laragon as a virtual host to open the projects in the browser, but to hear of a Docker I researched about it and it seemed to me the same…
-
1
votes0
answers164
viewsJob Format does not pass constructor data to Handler
When dispatching a job in Laravel 5.6, send parameters to it. In the constructor, the parameters are received normally, containing the data sent. However, when executing the job with the php artisan…
-
1
votes1
answer148
viewsBreak lines in a text that comes from the database in a single variable
I’m having difficulty inserting line breaks in the text that comes as a response from a select in the database through an ajax request. $('select[name=tipo]').change(function() { var value =…
-
1
votes2
answers159
viewshow do I restore a value of a Session object in the Laravel?
hello, I have this Session object and cannot access the arrays. How do I? Itero? Which loop would you use to have a certain arrays position? Cart {#268 ▼ -items: array:2 [▼ 2 => array:5 [▶] 1…
-
1
votes2
answers504
viewsLaravel 5.8 - Can we make Sync in a pivot table without the id field?
I have a table pivot with the countryside user_id and article_id (much for many), let’s say I have the following records: 1-2, 1-3, 1-4, 2-1, 2-2. At a certain point user 1 no longer wants to be…
-
1
votes1
answer231
viewsValidation Lumen/Laravel does not work
I am creating an API using Lumen v5.8, and before saving the data in the database I am validating data from an array sent by the user but the data never pass the validation. Controller <?php…
-
1
votes0
answers61
viewsQuery SQL in my Controller does not run on Server Error 1142
I created a website with Laravel 5.7, and uploaded to the server with the databases, all ok. All functions of my controller perform perfectly, except the Function down below: public function…
-
1
votes1
answer277
viewsFilter a Select2 by selecting an ion in another
I have a field of type Select2 that is bringing me all the customers of a database. As I do, when selecting a client, in another Lect2 appear only contracts of the selected customer, I can not think…
-
1
votes1
answer496
viewsSwap DEFAULT table from Laravel Framework Auth 5.8.15
Good evening, I would like to know how to use the auth of Laravel but with a different table, I saw some articles on the internet but could not change yet. I tried to overwrite the protected method…
-
1
votes1
answer41
viewsRedo array with maximum position limit
I’m working with Laravel and was looking at a bootstrap template to customize the application and came across this format to display the followers: My question is how could treat the array that…
-
1
votes1
answer21
viewsDoubt for view display
Good evening, I’m trying to pull the contents of my database ordered by the created_at field, but in the view nothing appears, no error, but nothing from the bank appears on the other hand. Code in…
laravelasked 5 years, 6 months ago spider tek 57 -
1
votes2
answers335
viewsValidation of a form
Hello, I searched and did not find well what I was looking for for my Laravel project so I need help! I have a simple form that receives the name, email and a message from the user, but I would like…
-
1
votes1
answer613
viewspreg_replace_callback() to remove characters that are not digits
I use Laravel and am trying to use the function preg_replace_callback() to remove point, comma, hyphen, dash and bar from the CNPJ numbers entered in the system. I used the function…
-
1
votes1
answer593
viewsUpdate field with select data
I have a field of type select that I select a driver, I would like when I select this driver the text field received the phone of this driver, which already comes with the information of the line of…
-
1
votes2
answers189
viewsGet the sum of last week’s records
Hello, I am studying Laravel I’m using the version 5.4, I need some help 'cause I’m not getting back the total records from last week’s database, I managed to return the total, and the total of the…
-
1
votes1
answer239
viewsErrorexception : array_push() expects Parameter 1 to be array, string Given
I have a problem with this function that generates a latitude and longitude Polyline. However whenever I execute the Laravel’s Seed it generates the following error: php ErrorException :…
-
1
votes1
answer959
viewsErrorexception : Illegal string offset
I have the following array. $polylines = [ 'latitude' = array(73.9289238, 83.928392832, 03.293892832), 'longitude' = array(-122.29839238, 21.928918291, 30.203929832) ]; I’m trying to execute the…
-
1
votes1
answer205
viewsReturn the same Pagination after a post in Laravel
I have a client page with a button that enables or disables a customer from that list. However if I am on Pag=4 (for example), when active or Deactivate the client I go back to the home page and…
-
1
votes0
answers50
viewsHow do I send any parameter via href and receive in the Resource controller in Laravel?
I made a screen that will have a button to view and another to edit, but the href on the button I have {{route('products.index', 'E')}} my route is so: Route::resource('products',…
-
1
votes1
answer88
viewsI can’t pass values from one page to another with Laravel
I have a problem with Laravel that I can’t solve, and I’ve tried many things: What I want is to take the values that are on one page and send to another on a form. The edit button in a list has the…
laravelasked 5 years, 4 months ago Calebe Pereira 29 -
1
votes0
answers68
viewsHow do I know if the pagination was clicked in the Readable?
I have a problem sending a parameter from one view to another. Until then beauty is working, but I’m having problems in paging, because it gives error in this parameter I need to send, to solve this…
-
1
votes1
answer24
viewsClear text coming from Laravel
I am with the following scenario, using the Plugin summernote for a textarea with the settings: <textarea id="summernote" name="editordata">{{$termos->termos}}</textarea> It returns…
-
1
votes0
answers32
viewsProblem in the logic of a tab system with relationship between tables
Personal I have two tables that relate to each other. Are they: Category: public function up() { Schema::create('categories', function (Blueprint $table) { $table->increments('id');…
-
1
votes1
answer261
viewsReturn database search with Controller
I’m trying to take the content name of an input from my search page (Search), and send it to another view (Data), where the controller will receive this value and from there will search the database…
-
1
votes1
answer42
viewsLaravel:I can’t Download a file
I have tried several tutorials and researched similar problems here in stack,but without success ,previously I took the id of the file and it was passed as parameter and did not return anything.Now…
-
1
votes3
answers1872
viewsCreate a Request validation in Laravel with the Unique rule
I created a request with the command: php Artisan make:request Nameserver And in the controller I’m calling him so: public function nomeDaFuncao(NomedoRequest $request) { } Only I need to use this…
-
1
votes1
answer127
viewsSelect no Laravel is returning the column name (Eloquent)
I’m having trouble returning only the value of select in the case is the name ,but it is returning as if it were string and this with column name. Controller public function…
-
1
votes2
answers199
viewsRelation Hasmanythrough returns empty Eloquent
I am developing a sale screen and on this screen it is possible to select several products that belong to the table produtos, the structure of the tables is as follows:: vendas: - id produtos: - id…
-
1
votes1
answer197
viewsDoes setlocale not work on Amazon EC2 instances?
I am developing an application in Laravel where I needed to use the function resources setlocale to translate the months of a given day into Portuguese. A month ago I had published a question…