The results are in! See what nearly 90,000 developers picked as their most loved, dreaded, and desired coding languages and more in the 2019 Developer Survey.

Questions tagged [laravel]

Laravel is a free, open-source PHP web framework, created by Taylor Otwell and intended for the development of web applications following the model–view–controller (MVC) architectural pattern and based on Symfony. The source code of Laravel is hosted on GitHub and licensed under the terms of MIT License.

0
votes
0answers
5 views

How to link image in dynamicPDF plugin in HTTPS

I am generating dynamic PDF for the user in which i am printing the images of user gallery it was working fine in shared hosting with HTTP but not working in AWS EC2, it show "image not found or ...
0
votes
0answers
8 views

Laravel Eloquent Filtering Results

In my controller I retrieve a list of messages from the message model. I am trying to add a filter, but the filters are cancelling each other out. // Controller public function __construct(Message $...
1
vote
1answer
12 views

Laravel - Soft delete isn't taking effect

I'm having an issue with soft delete. I have a feature in my app where a user can star a followed property advert. They can also unstar a property advert. This works fine. when they unstar it, the ...
0
votes
0answers
8 views

Undefined Index: publicProfileUrl for Linkedin - Laravel/Socialite

When someone tries to sign up to my website when their LinkedIn profile visibility is not public (i.e., this) , then my website returns an undefined index / error exception message for when the person ...
1
vote
3answers
35 views

Fill empty dates in array of dates in PHP

I have an array in codeigniter like below. As shown below, there are some spaces between dates. After 1st April, there is 3rd and after that its 10th and so on. Array ( [2019-04-01] =>...
0
votes
0answers
7 views

Guzzle | Async requests | Invalid resource type error

I am trying to chain http requests, where the second request is dependent on the response from the first. I came across Guzzle Client->sendAsync(). The error I get: exception: "...
-1
votes
1answer
10 views

Laravel homestead database not found issue

Hi I'm trying to use laravel homestead. I ran vagrant up and vagrant ssh commands. But when I try to access in browser I get this error, SQLSTATE[HY000] [1049] Unknown database 'mydb' (SQL: select ...
0
votes
0answers
7 views

How create recursively ZIP file, from array which contains total directory paths WITHOUT the name of the pdfs inside

I have a directory with name 2019. I want to create a ZIP file which contains all the pdf files inside the folders 01-03. In a for loop i fill an array with all the paths of the directories who are ...
0
votes
1answer
14 views

How do I delete all UNUSED images from my uploads directory if do not saved in Database in PHP

I use laravel 4.2 I have more than 1,000 images in the project; these images have been occupied by host users after multiple uploads. Please edit the sample instance in such a way that it will erase ...
0
votes
1answer
18 views

get key of element in @each directive

I found an @each directive that seems to be useful but as I checked in the definition in: Illuminate\View\Factory; in: public function renderEach($view, $data, $iterator, $empty = 'raw|') the $...
0
votes
0answers
9 views

xlsm file modification data of specific column on specific tab

I want to modify a column data of a specific tab when I upload file(.xlsm) in laravel. After that that modified file can be download. How can I do that? Is there any suggestion that will help me ...
-1
votes
0answers
29 views

How to fix “Undefined offset: 0” when I trying' to get value from database using “aliases” in Laravel

When I trying' to get value from database using aliases "as", I got an error like this : at HandleExceptions->handleError(8, 'Undefined offset: 0', '/data/gui/hum/hum.v3.1/vendor/laravel/...
0
votes
0answers
20 views

Import databases infos from mysql in database.php

I would like to get databases informations stored in my database in the database.php. I tried to get all infos in the database but I always have an error like this : [2019-04-18 16:13:16] laravel....
0
votes
1answer
43 views

How to get id from the task in which I click

So I have "tasks", and each task can have multiple notes. I display tasks like this: <table class="table table-bordered table-hover"> <thead> <tr> <th>...
0
votes
0answers
10 views

Laravel font extensions validations

I am using Form request validation to validating font extension. I'm uploading font types, and my rules are so: public function rules() { if($this->method() == 'POST') { ...
0
votes
1answer
8 views

Sentinel Package: Getting all logged in Users

I'm using Sentinel in Laravel for user management. I logged in 2 users and I try to get a list of all logged in users but this only returns the very last user to log in. The code below is one of my ...
0
votes
1answer
15 views

Laravel - How to access related object other relashionship

I have 3 Models "Category", "Post", and "User". A Category has a hasMany relationship with Post. And a Post has a belongsTo relationship with User. I have a Category object $cat1 and i can access its ...
-2
votes
0answers
20 views

Is it possible to improve 400 requests per second (nginx+laravel+percona)? [on hold]

Trouble is 400 req/sec via (nginx+laravel+percona). I want 2000 req/sec on the same hardware, but i dont know how. It`s pet project and I want to make project similar highload. Full architecture ...
0
votes
0answers
15 views

Removing global scope from builder

Since I am using Laravel 5.1 and in that version the function withoutGlobalScope() wasn't implemented, I tried to overcome it like this: Scope class: class RentsScope implements ScopeInterface { ...
0
votes
0answers
11 views

PhpWord - TemplateProcessor: error copy template

I have developed a Laravel app that read a .docx template, populate and save it in pdf format. On my pc and some server it works greatly, but with a new Debian 9 VPS I have a strange error. When I ...
0
votes
0answers
11 views

laravel and react pusher setup

i was working on a web project, I have laravel as my back-end reactjs as my front-end i have users, posts comments in my DB i wanted to implement pusher so i can have this real time posts ...
0
votes
1answer
12 views

How to use Multiple Databases based on subdomein in Laravel

What I want, is to access a separate database, based on the subdomain. All other settings keep the same: username, password etc. Only database name needs to change. I add This to database.php file '...
0
votes
3answers
30 views

How to convert this SQL statement to laravel code?

So I have two tables Animals and Adoptions The animal table holds [animalID, name, DOB] Adoptions hold [id, animalID, userID, approved] I need to write a statement which would match the animalID in ...
0
votes
1answer
20 views

Updating multiple id from array list with eloquent

I've passed to the controller an array of id and it is collected inside the student variable. I want to update the database column "lecture_id_FK" for each id in the array. I'm not sure as to how to ...
1
vote
3answers
27 views

Replacing object ID by object name on URL on Laravel route

I am trying to make my URL more SEO friendly on my Laravel application by replacing the ID number of a certain object by the name on the URL when going to that specific register show page. Anyone ...
-1
votes
1answer
39 views

Laravel - How to implement a pivot table?

No information on how to set one up... Okay, so the time has come that I need a pivot table, but Laravel's documentation kind of sucks when it comes to pivot tables, and just doesn't explain it in a ...
1
vote
1answer
40 views

Null return from controller

I have a service file where I'm running a stored procedure: function createCampaign($campaignName, $groupNumber){ $stmt = \DB::connection('odbc')->getPdo()->prepare('CALL SCHEMA....
0
votes
0answers
23 views

Login on second guard causes logout on both Laravel

I have 2 guards on my website customers and admins. For some reason when I am logged on admin and try to login in on customer account I get logged of from admin. After that customer login form is ...
0
votes
2answers
34 views

“Trying to get property 'headers' of non-object” Middleware\VerifyCsrfToken.php:180

I wrote my custom middleware, but when it is executed, the error appears. Middleware: namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; use App\Employee; class ...
0
votes
2answers
22 views

Laravel: Select Distinct on one to many relationship

So i have this relationship between my two Models Product.php public function photos() { return $this->hasMany('App\Photo'); } Photo.php public function product() { return $this->...
-3
votes
1answer
29 views

What is equivalent of CodeIgniter's $this->load->vars() in Laravel?

In CodeIgniter I use $this->load->vars() to pass an array of data along with the loading of view. In my target view, I use $this->load->get_var() to get that array and then the array is ...
0
votes
0answers
14 views

Pusher Subscription Issue

When I try to subscribe the channel, it does not give any response neither succeeded nor error. var channel = pusher.subscribe("chat_chanel"); channel.bind('pusher:subscription_succeeded', ...
0
votes
1answer
21 views

JWT Auth Error : The token could not be parsed from the request

Currently I'm developing Laravel 5.8 with using JWT Auth, everything running as well in Postman, but when I tried for testing on Browser, I got a lot of errors and one by one has been fixed. Now I'm ...
3
votes
2answers
36 views

How do I check if a user has like a property

I'm making a property advertisement website. In the app users can like or 'star' a property. This created a record in the starred table with the property_id, and the user_id. I want to check if the ...
-1
votes
2answers
37 views

Testing with a session data to display a photo in a blade page

I want to test "sexe" to display a photo. I use the session but nothing happens. That's the controller: public function store () { request()->validate([ 'username'=>['...
0
votes
0answers
24 views

Laravel custom guard exclude routes

I have created a custom auth guard for laravel 5.8 and is registered to the AuthServiceProvider. Using the constructor definition below inside a controller, I want to exclude specific routes from ...
1
vote
1answer
27 views

pass array of join to query in laravel

I have issue with my query. My sample query is as below $answers = DB::table('IC2017_AY') ->join('IC2017', 'IC2017_AY.UNITID', '=', 'IC2017.UNITID') ->join('SFA1617_P1', '...
4
votes
2answers
36 views

Custom hasMany relationship query with select()

Each company on my app can store its own events. A company and its events are related though the following hasMany relationship: /** * The events that belong to the company. */ public function ...
0
votes
1answer
19 views

Passport can not generate refresh token

Can you please help me ? I want to generate refresh token in passport. I can generate a refresh token only if I use default hash password from Laravel. What I mean is this situation: I create a new ...
0
votes
4answers
25 views

General error: 1215 Cannot add foreign key constraint, Laravel 5 & MySQL

In a blank Laravel project, I want to create foreign key constraint between users and questions, where users table will hold build-in Laravel User, but Question will be a custom model. After running ...
0
votes
1answer
44 views

Auth::guard('admin')->user() return always null

I define a new guard "Admin" to have a multi Auth System User and admin in my project . when i login it is ok and i get the token to the rest of my api routes .When when I use The auth::guard('Admin')-...
-1
votes
2answers
35 views

How to get Last seen online time in Laravel

In User profile view i need to show user's online status. If he/she is online will show online if not then need to show Last seen at 4:30 PM . I am using Laravel's Cache for this. I have created a ...
0
votes
3answers
29 views

How to access files of public folder in Laravel and Linux OS

Linux can't find the css, js etc. files which are placed in public folder. I am using this code to access my files: <link rel="stylesheet" href="{{ URL::to('css/styles.css') }}"> And it is ...
5
votes
0answers
38 views

barryvdh laravel dompdf rendering just two pages

I am using barryvdh laravel dompdf for rendering pdf from html view in laravel 5.7. It was working fine but when the view exceeds to more than 2 pages it cuts the page and does not print the third ...
-1
votes
1answer
14 views

Memory Issue with Importing Huge Excel File using Laravel-Excel

Am using Laravel Excel 3.1 to import a huge excel file with roughly 800,000 records. The import goes on well, but exhaust the memory. MY CASE: am using shouldQueue, chunkReading of 1000 and ...
0
votes
0answers
24 views

How to create a system which handles multiple 3rd party APIs? [on hold]

I'm trying to create a system which has users and those users are able to enter some kind of data. For the sake of the example lets say the user enters a location and then they're able to select the ...
-1
votes
3answers
30 views

Insert big data from csv to mysql gives HTTP ERROR 500 using laravel

I m trying to insert 400k records from csv to mysql using laravel query builder but it gives http error 500 after inserting almost 150k records on server but on localhost it works fine as expected i ...
1
vote
2answers
48 views

Save multiple dropdown options in an array

I am generating questions from a database where the user will select answer in a drop-down menu.When a user selects a certain option,a suggestion will be pushed to the array triggering on-change event ...
0
votes
1answer
27 views

How to run AngularJS project with Laravel

I want run my Angular front-end client within Laravale index.html. I have mange to set up and build both projects. When I open Laravel Client at port 8000 it says it can not find any of the .js files ...
0
votes
2answers
21 views

passing value to blade without use of foreach

i am trying to fetch a single row value using its' key in blade file table. how do it pass value to it. i have fetched the whole table in another blade file using foreach i have passed the data ...