Most voted "laravel-5" questions
Laravel is an open-source framework for developing web applications and services with PHP. Use this tag for specific questions about Laravel 5 or later.
Learn more…751 questions
Sort by count of
-
0
votes1
answer2525
viewsMiddleware Laravel Group Authentication
save guys, I want to know how to project my admin route so that the user does not have access to this route but they both have to be authenticated. My routes Route::group(['middleware' =>…
-
0
votes1
answer529
viewsView password with hash in database, decoded
I’m saving the passwords in the hashed database, and now I want to view it in the view, because when I get the data in the database it still gets hashed when I’m going to display it. Senha:…
-
0
votes1
answer42
views -
0
votes1
answer965
viewsLaravel 5 Eloquent View Blade with Foreign Key?
I get the following error: Trying to get Property 'name' of non-object I have a list of Suppliers and Payments, and I am using the following syntax to retrieve the Vendor name through the foreign…
-
0
votes0
answers34
viewsEmpty Line Problem - Laravel
I have a problem, I have a few months of experience in Laravel and I did not see this kind of problem happen, when submitting a form appears the following error: Error Exception Trying to get…
-
0
votes2
answers718
viewsUser does not authenticate Auth
I can’t get the user authenticated, so he enters my route with middleware auth... I can log in but I can’t get the user logged in, for example I can’t enter any route with middleware auth and nen…
-
0
votes1
answer392
viewsHow to make Foreign Keys using Migrations Laravel
I’m trying to relate one field to another using Migrations this way: But when doing foreign key in Migrations this way: Migration Permission: Schema::create('permissions', function (Blueprint…
-
0
votes1
answer52
viewsHow To Use Where IN in Query
How can I perform a query below with mysql in the: SELECT gps.positions.id, gps.positions.protocol, gps.positions.deviceid, gps.positions.servertime, gps.positions.devicetime, gps.positions.fixtime,…
-
0
votes2
answers131
viewsDelete element from array
I have a form with 60 input textbox with name number[], of those 60 numbers I can only select a quantity x( quantity can be variable ); as I do for when the user unchecks the checkbox the number is…
-
0
votes1
answer307
viewsHow to find the last 5 images inserted in the seat and show in a carousel?
I want to take the last five images in the bank and show them on a carousel, with the respective title, and those marks that indicate the image being viewed. I’m working with Laravel 5.1 and mysql.…
-
0
votes1
answer136
viewsSort Collection through multiple columns
I need to sort a Collection first through the fieldpoints and then by company_fantasy I tried some ways as this post…
-
0
votes0
answers132
viewsError running "npm run dv"
npm run dev @ dev /var/www/Upevent node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules…
-
0
votes0
answers35
viewsLimit relation by common attribute
I am working on Laravel and I have 3 tables (users, administrations and immobles). I would like to know, what would be the best way to relate (associate) users and properties that belong to the same…
-
0
votes1
answer44
viewsAger loading and custom queries
This question is a follow up of this and of this. But I’ll try to make them independent. I have the following tables, weathers: +--------+-------+---------+ | id | temp | id_freg |…
-
0
votes0
answers519
viewsLaravel 5.6 - Error passing 2 parameters in url
Hello, I am trying to pass 2 parameters to my controller using url and am getting the following error message: Missing required Parameters for [Route: Teacher.average_faults] [URI:…
-
0
votes0
answers103
viewsdetach() method deleting more data
my detach method erases all data from the student table (it removes the data from the association table but deletes all data from another table) $team = Team::find($id);…
-
0
votes0
answers62
viewsLaravel shares session
I have a system A where I store a session $login = $request->input( 'login' ); $request->$session()->put('login', $login ); And a system B which stores the session:…
-
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
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
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
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
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
answer141
viewsHow to pass an array by ajax to the controller?
I have an ajax that sends data from my selects to my controller and from there I do a check and query, so far everything is working perfectly. The problem is that the last select that sends is an…
-
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
votes2
answers77
viewsHelp Query Sum
I’m trying to retrieve a column and make a sum - using the SUM - according to the time zone, but without success. You can help me with this issue? Detail: I’m not using exactly a table, but perform…
-
0
votes0
answers85
viewsProblems with Stored Procedures on Laravel 5.6?
I’m making a select in a procedure, but I can’t page because the result returns array: DB::select('EXEC PR_MONITORAMENTO @FUNCAO="S2", @ID_CD_INTERNACAO='.$ID_INTERNACAO.',…
-
0
votes2
answers985
viewsLogin customizado Laravel
I’m trying to do a custom login on Laravel 5.5, I can even authenticate the user, but when I direct to another page it loses the authenticated user reference and redirects to the login screen again.…
-
0
votes1
answer144
viewsLaravel activitylog, error in implementation
I’m following the documentation of the site: https://docs.spatie.be/laravel-activitylog/v2/basic-usage/logging-activity, but I’m not able to implement the option below: Setting a You can specify on…
-
0
votes1
answer677
viewsNot to pass an element ID through the Laravel URL
This is my route: Route::get('empresas/deletar/{notice}', 'EmpresaController@deletar'); This is the action of the button: This is my role in Controller: What happens if I pass this URL directly in…
-
0
votes0
answers83
viewsInitial SQL to list clients (PF and PJ). How to migrate a pure SQL Query to Laravel Eloquent?
I set up an initial SQL to pull the data. It’s working in pure SQL. I need to migrate this code to Laravel’s eloquent pattern. Can anyone help me? Thank you! Follow the example SQL: Code: SELECT…
-
0
votes1
answer241
viewsPusher Error - Uncaught Referenceerror: Pusher is not defined
Good morning. I followed this tutorial to the letter: https://pusher.com/tutorials/chat-laravel But I get the following error in the browser console: Uncaught ReferenceError: Pusher is not defined…
-
0
votes1
answer275
viewsHow to create Laravel search by taking data from the cache?
Since I have this data in a file I see no reason to make a request in the database. Example of my curly code: $produtos = Cache::rememberForever('produtos', function () { return…
-
0
votes1
answer35
viewsDoubt with route
I’ve been trying for a while to make a route work, but so far nothing... Controller: public function profissionais(Request $request, $id){ $vinculo = session()->get('vinculo'); $profissionais =…
-
0
votes1
answer230
viewsLaravel Mail, Error: Undefined variable
Good evening friends, I’m having a problem, when I try to pass the variables from one control to the other, he ends up accusing that the variable "was not defined": (Undefined variable: Black and…
-
0
votes1
answer3569
viewsAjax (POST) Laravel
I am having the famous error 419, that for a certain moment I was able to solve, but after restarting the server, it stopped working. Route: Route::post('ajax/Register', 'Ajax@Register');…
-
0
votes1
answer571
viewsI am not allowed to write in a directory in Laravel 5.6
Hello, I’m having trouble writing in a directory in Laravel 5.6, I created the directory on the server and when I will upload it gives this error: unable to write in the "uploads/imagens/assinatura"…
-
0
votes1
answer159
viewsLaravel array Session overriding
I’m trying to record product data in a Laravel, but it overwrites the session. I have an array of products in the view: @foreach($products as $product) <form action="{{ url('/cart/add') }}/{{…
-
0
votes0
answers163
viewsListing in
Hello, I have following modeling: A training table that has several training models (workouts). The models table has several exercises. At the Laravel, I need to list a particular workout (id 1, for…
-
0
votes1
answer455
viewsthrow new Methodnotallowedhttpexception($others); Laravel 5.7 Sending HTML form
When creating the update in Laravel this giving the error. protected function methodNotAllowed(array $others) { throw new MethodNotAllowedHttpException($others); } View {!! Form::model(array('route'…
-
0
votes1
answer73
viewsFile not found error while moving image in Laravel
I’m trying to move an image that’s located inside storage/temp for storage/app/public/erro_log with the method Storage::move();, but I get the error of File not found, even if the image is at the…
-
0
votes1
answer441
viewsLaravel design error 5.7
My project started presenting the error below when I run any command php artisan ...: $ php artisan --version PHP Fatal error: Uncaught ReflectionException: Class config does not exist in…
-
0
votes2
answers188
viewsList data from two unrelated tables in the same view
I have a view called form where I need it to appear, in the select field, the States(UF) coming from Mysql. I have the EstadoController where in the index method I do the listing using all. Now, I…
-
0
votes1
answer75
viewsFunction does not work within class [Laravel]
I’m trying to call one function inside another in one of the controllers of my Laravel project, but when the flame the page is all blank and presents no error. public function index() {…
-
0
votes0
answers41
viewsAuthentication routes not defined, Standard 5.7
I can’t access the route http://localhost/login directly and nor http://localhost/logout. Route::get('/', function () { if(Auth::check()) { return redirect('/dashboard'); } else { return…
-
0
votes0
answers61
viewsPassing variable to view and capturing
I have tried several ways to capture the variable I pass to the view, but without success. Controlle public function destroy($id) { $retornoDestroy = $this->qpae->find($id); $delete =…
-
0
votes0
answers22
viewsUnauthorized json php error
I’m hoping that when selecting a municipality the regional automatically select but this error is making me break Muringa. Can someone help me? The route is correct I’ve checked several times. below…
-
0
votes0
answers173
viewsjQuery $ is not a function/is not set
Good morning, you guys. I’ve been trying to solve this for some time but without success. It seems that jQuery is not being loaded or assigned in $, jQuery. Below are some snippets of code to…
-
0
votes2
answers74
viewsArtisan Command - Foreach Laravel - Count affected lines
I created a command in Laravel to run at a certain time and now I need to get the result only of the affected lines. The method I used makes a count of the entire loop. $count = 0; foreach…