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
votes0
answers26
viewsGet the two objects of an array
I receive a request with the following object: { "member_id": 1, "lista": [ { "id": 1, "member_id": 1, "instituicao": "Teste Fund", "data_inicio": "2018-04-25T06:00:00.000Z", "data_termino":…
-
0
votes1
answer64
viewsJunction of Laravel searches
I have the function in my controller: public function pesquisa(Request $request) { if (! Gate::allows('celular')) { return abort(401); } $marcas = CelularMarca::orderBy('nome',…
-
0
votes2
answers1473
viewsSearch the database and return the value - Laravel
I’m doing a search in my database, I want to take the value found and save it (are two different tables) but the value is not being saved, is being saved the number 0. I use this command in my…
-
0
votes1
answer150
viewsReduce function in controller
I wonder if you have how to rewrite the function below in a cleaner way without so many if / elseif. public function pesquisa(Request $request) { if (! Gate::allows('celular')) { return abort(401);…
-
0
votes1
answer702
viewsRoute api in Laravel 5.4
Through Composer, I started a project with the command: composer create-project --prefer-dist laravel/laravel api After the installation of the dependencies, I was able to visualize the "Welcome" of…
-
0
votes0
answers836
viewsSelect 2 in bootstrap 3
There is some way to use Select2 in Bootstrap 3.3, have some example for me try to implement, I am building my TCC on top of the adminLTE template and needed something like it in some queries, I…
-
0
votes1
answer350
viewsDoes not work the "Soapwrapper" with Laravel
I am trying to consume a WS through application in Aravel 5.6. That’s the test code: namespace App\Http\Controllers; use SoapClient; use Artisaninweb\SoapWrapper\Facades\SoapWrapper; use…
-
0
votes1
answer119
viewsError when testing with Laravel Dusk
Good morning guys, has anyone ever had experience with Laravel Dusk who can help me? I can not do the Authentication by Browser to be able to access the screens, in my case I have different Wards,…
-
0
votes1
answer123
viewsHow to display two different tables in the same view?
Using the Laravel 5.6 I am trying to display two different tables in the same view, but it is giving error this is my controller <?php namespace App\Http\Controllers; use Illuminate\Http\Request;…
-
0
votes0
answers708
viewsAutocomplete no Laravel
Eae guys td well? so I’m trying to develop an application in Laravel and I happen to be putting an Autocomplete but it’s not running. Please help me out there! This here is the ajax…
laravelasked 6 years, 6 months ago Victor Gabriel 61 -
0
votes1
answer65
viewsClauses wherein and whereNotIn
I have two tables, one has the disciplines and the other has the periodo_disciplines, I filter the course and the period. I need to bring only the disciplines that are not launched in the table of…
-
0
votes0
answers373
viewsCount multiple records for Chart on Laravel
How do I count multiple records with Laravel? Example: Table homicios, count the columns month, date, city separately and generate the chart in Chart. Chart 1: Jan - X quantity Feb - X quantity Etc.…
-
0
votes0
answers136
viewsIonic 3 + Standard. Problem with http request on server
Edit: Solution 000webhost does not accept requests 'options' on your free plan. I was able to solve the problem by making the Lockable available on local network with the function php artisan serve…
-
0
votes1
answer285
viewsJSON in Laravel
I wanted to know how to send the data of the query in json through the controller and how the view should receive them. Controller: $dados = $req->all(); $query = ""; if($dados['filter'] == 1) {…
-
0
votes0
answers81
viewsAngularjs ng-repeat does not display data
I made the request via get using the Laravel as backend. However, if I update some data in the database itself, I need to refresh the page where it is loaded angular for it to update. Using the…
-
0
votes0
answers116
viewsPOST com Angularjs e Laravel
I’m trying to send via POST to my backend Windows, but on the console it points out the error: POST http://localhost:8000/new 500 (Internal Server Error) ! ! Here is my code from Angularjs…
-
0
votes1
answer223
viewsHow can I get information using Lockable with chained Join?
I have 3 layers of entities, of which I only want the third object. but based on the information of the first 2. For example, I have manufactures that manufactures cars and each car has a kind of…
-
0
votes1
answer47
viewsIterate an array to the end from a randomly generated index - PHP/Laravel
Good evening, everyone. I have an array with some bus stops with the following information: array:9 [▼ 0 => array:4 [▼ "id" => 35 "nome" => "Parada 35 - Copacabana" "endereco_completo"…
-
0
votes2
answers851
viewsSharing variables between functions in the controller
I have a function in my controller that receives some requests, and in the end everything is stored in two arrays. In this role, if I do the following: return view('negocio.detalhes-trajetoa',…
-
0
votes2
answers719
viewsHow to return ajax errors with jquery in Laravel 5.6
From what I read in the documentation, when using ajax, the answer is always returned in json, but I cannot receive the information to print. The message returned on the console is:…
-
0
votes0
answers30
viewsProblems to recover data after page redirection
I made a file to store the citizen data in an array, because only in another step will I have confirmation if I should actually store this data <?php namespace App\Services; class CidadaoStore{…
-
0
votes0
answers37
views$request->input always returns null
Angularjs file $http({ method: 'POST', url: API_URL + "produto/update" + "/" + produtoSelecionado, data: $.param(obj), headers: { 'Content-Type': 'application/x-www-form-urlencoded' }…
-
0
votes1
answer330
viewsAuthentication on Laravel API routes
I’m conducting some tests in the construction of a API with Laravel. At the moment all URLS of API are with access without authentication. I am trying to allow after user authentication. In…
-
0
votes1
answer251
viewsLaravel: Problem with foreach
public function extract(){ $occupation = Occupation::join('invoices', 'occupations.id', '=', 'invoices.occupation_id') ->leftJoin('payments', 'invoices.id', '=', 'payments.invoice_id')…
-
0
votes1
answer480
viewsLaravel - Website Authentication and API
I am developing a Chat where it can be accessed both by the web and by an application, so I have done a project in Laravel with an api, both the site and the application will be fed through the api…
-
0
votes1
answer85
viewsLaravel - active menu
I am trying for the first time to develop a test website using Laravel and am following a video tutorial on youtube. Everything is going relatively well, but I have a little question that needed…
-
0
votes1
answer449
viewsRelate more than one value of the same row to another table (Laravel)
I’m new to Laravel and wanted to know if you can solve my problem without being in pure PHP, that is, using Laravel’s own resources. Follow the current situation and what I wish to do: I have a…
-
0
votes2
answers220
viewsCreate route template in Laravel with Resource
I would like to know how to create a template in the Blade containing generic actions (view, edit, delete) for all routes of my application, for example in the column of actions I have the code:…
laravelasked 6 years, 5 months ago Rafael Meirim 321 -
0
votes2
answers216
viewsError configuring Passport in Laravel
I have an API in Laravel and in it, I need to authenticate the access requests. So, I used Passport Laravel, only according to the return of the API, there is some definition that I did not inform…
-
0
votes2
answers49
viewsController method getting wrong value in Laravel
A piece of my application, consists of the client logging in and from there registering some relevant information daily. When logging in, it drops to the screen to choose which capture it will log…
-
0
votes0
answers140
viewsAPI when online, returns: 'Route [login] not defined'
I’m testing a API I am developing, in localhost I can make a certain request and it returns to me everything 'ok'. By doing the same test on a server, it is returning a 'Route [login] not defined.'…
laravelasked 6 years, 5 months ago user108720 -
0
votes1
answer610
viewsPass variable query buider Laravel
I am trying to do this function with Laravel Query Builder public function getEstudantesCargaHoraria(Request $request) { $ano_letivo = $request->ano_letivo; $turma_id = $request->id;…
-
0
votes1
answer164
viewsHow to use Laravel Localization?
I have a question to use the Localization of Laravel correctly, I have an application in Portuguese and I have to translate it into English.. my doubt is the following ex: <h2>Isso será apenas…
-
0
votes1
answer553
viewsVariable returns NULL - Trying to get Property of non-object
I’m using Laravel 5.6 along with the Adminlte. When I log in it is returning me the error Errorexception (E_ERROR) Trying to get Property of non-object Indicating the view page.blade.php, in the…
-
0
votes1
answer1294
viewsError saving monetary data: A non well Formed Numeric value encountered
Contextualization: I’m using the library *Jquery-maskMoney to format monetary data. But when saving this data the following error occurs: A non well Formed Numeric value encountered Jquery library:…
-
0
votes1
answer308
viewsLaravel - View [.site.Home.index] not found
I opened my localhost today to continue to start my project and I will have this error in all the pages I try to access, yesterday before closing the pages was working can anyone help me? error View…
-
0
votes0
answers37
viewsAverage sales ticket using AVG Laravel
I’m trying to calculate the average sales value of a store but I’m facing some problems in calculating the total value of each sale, follow the code Controller: $valor_total =…
-
0
votes1
answer181
viewsRoute with variable
I would like to know in Laravel, when saying the name of the route, it accepts the variable, instead of the name itself, as for example: Example: Instead of being like this: {{ route('minhaRota') }}…
-
0
votes1
answer15
viewsRecording errors from Soap-Server
I have a client-Soap in Laravel and I would like to know how to save errors coming back from Soap-server in a file. Below is the code of my client-Soap and where does the request for Soap-server.…
-
0
votes1
answer51
viewsRelationship between tables Aravel 5.5
I would like a suggestion on how to implement relation between tables in the Laravel using Migration. public function up() { Schema::create('professors', function (Blueprint $table) {…
-
0
votes2
answers111
viewsLaravel does not install
kalil@debian:~$ composer global require "laravel/installer" Changed current directory to /home/kalil/.config/composer Using version ^2.0 for laravel/installer ./composer.json has been created…
-
0
votes1
answer697
viewsGroup and add values from each group of a php array
I have the following array: array(9) { [0]=> object(stdClass)#2477 (4) { ["type"]=> string(2) "in" ["category"]=> string(24) "Tratamento Odontológico" ["value"]=> string(15)…
-
0
votes1
answer42
viewsCreate a link to a single password-free user in the database
Currently I have a BD of budgets, customers and workshops. When I demand a customer I have to quote in the workshops the value and then choose the best cost x benefit and pass on to the customer.…
-
0
votes1
answer165
viewsSend form without loading page via json
I’m developing a website and I’m using Windows, and I need to send a form without updating the page, I’m using jquery but I don’t know much how someone can help me?. html form <form>…
-
0
votes1
answer79
viewsRelationship error and method not found
I am studying Laravel and I have difficulties to realize the relationship of an associative table that connects 3 tables of domain. example of my model: The problem is that I can’t map from my…
-
0
votes1
answer568
viewsArtistic key error while trying to generate
I pulled an example of a design of Lockable and when having give a php artisan generat:key he returns me the following mistake [Dotenv\Exception\InvalidFileException] Dotenv values containing spaces…
-
0
votes3
answers789
viewsDoubt Passing Laravel Array Routes
The doubt is the following, in my PDF generator, when I click on generate, it generates a pdf with all the information that is contained in the tables of the database, so I’m in doubt dom how to…
-
0
votes1
answer249
viewsLaravel - does not write price when value is NULL
I have a Laravel mutator to treat a field, but if the field comes empty it does not save the default value in the bank. MODEL /// PROMOÇÃO TROCA VIRGULA POR PONTO public function…
-
0
votes1
answer650
viewsAccessor/Mutator do Laravel
Replacement of "," by "." by Laravel Mutator Returns empty and unsaved in the database. Productoscontroller namespace App\Http\Controllers; use Prettus\Validator\Contracts\ValidatorInterface; use…
-
0
votes1
answer38
viewsError with relationship - Laravel
Guys, I’m with 2 related tables and I want to show you 1 dice that has a just "pulling" this relationship. tables: Users: Permissions: Table that will list: Code: @foreach(App\User::all() as $user)…