Use Stack Overflow for Teams at work to find answers in a private and secure environment. Get your first 10 users free. .

Questions tagged [laravel-5]

Laravel 5 is the previous major version of the open-source PHP web development MVC framework created by Taylor Otwell. Laravel helps you create applications using simple, expressive syntax. Use the laravel tag for general Laravel related questions.

Filter by
Sorted by
Tagged with
0
votes
1answer
23 views

laravel5.8 Image preview before uploading a profile photo

I have profile image upload section. I want to preview an image before uploading. But I got an error saying Too few arguments to function I have already executed php artisan storage:link but I ...
0
votes
0answers
8 views

After deployment of Laravel code from local server to live server admin subfolder dashboard not redirecting

I uploaded my Laravel website from demo server to live server which is in shared hosting. Previously in my demo server when I try to access admin dashboard it was working but when I tried to access it ...
0
votes
0answers
18 views

PHP Laravel 5.8 Auth Attempt always return false in PHP 72

Running the same code, request parameter and database on different machine specification resulting different behavior. First one we ran on our sandbox server with specification bellow Centos 7 ...
1
vote
1answer
15 views

Laravel paginate with only first result

i'm kinda new to Laravel so I hope the question is clear enough. I have a table with Users and another table with Tasks. In my User model I have the following : public function tasks() { return ...
0
votes
0answers
12 views

el-select from Element Ui not adding or removing items?

I'm using the el-select to add tags and sizes to a product with a form, when I add a new product it works no problem, but when I try to edit an existing product I can't delete or add any tags or sizes?...
0
votes
2answers
18 views

Cannot access protected property parameters laravel 5.5

I'm trying to get the parameters from the $request like following: $request->request->parameters but i get this error Cannot access protected property Symfony\Component\HttpFoundation\...
0
votes
1answer
36 views

How to convert docx file to PDF?

I am using Laravel 5, and I want to convert a Docx file to PDF. Can any one can suggest me best way that I could convert docs to PDF? I tried with DOMPDF but it gave result in black & white, with ...
-1
votes
0answers
43 views

Laravel Redirect Not working even after defining correct route [duplicate]

Not sure what is wrong in my code but this line is not redirecting. if ( $current_SIL_available_user < $number_wil_physical_delivery ) { return redirect()->route( 'request_physical_delivery'...
0
votes
1answer
33 views

Laravel 5.8+get array of columns and rows from query

Relatively new to Laravel and trying to create a REST api that will have as a response a json that is split between rows and cols of a query So, the code used to generate the json is: $r = array( ...
0
votes
0answers
15 views

How do I pass a formulea from a custom helper file into an Event Listener Message Body in Laravel?

I have a method for calculating volume of water as follows: function getVolumeM3($dgross, $land_size) { return (round($dgross * $land_size)); } Using the above formula am gettting an integer ...
0
votes
2answers
39 views

Cannot add foreign key constraint - Laravel Migration Error

I have multiple migrations but the two which I think are relevant to this question are the 'job' and 'session' migrations. Job Migration Schema::create('job', function (Blueprint $table) { ...
-3
votes
1answer
29 views

js/app/js file net::ERR_ABORTED 404 (Not Found)

I'm setting up an authentication in laravel5 , but js and css don't work on my web page <script src="{{ asset('js/app.js') }}"></script> GET http://127.0.0.1:8000/js/app.js net::...
-2
votes
1answer
49 views

How to resolve a target class which doesn't exist?

I'm following an Auth API laravel tutorial from a website. I'm testing the endpoints with Postman where I am consistently getting this error. "Target class [App\Http\Controllers\Auth\...
0
votes
0answers
24 views

How to only show logged in user's posts to user in Laravel Voyagers?

I had installed fresh Laravel project and added the Laravel Voyagers Package in it. Later I had created the Product table with id, title, user_id and created its respective BREAD. User can have ...
1
vote
0answers
23 views

How to show img in laravel app using javascript

I am working in Laravel to print a badge and ticket. I have one problem. The image is not showing even if the link is correct, via Javascript, but if I added the same image directly in HTML then it ...
1
vote
2answers
32 views

Not able to output “total registrations today” count

I am trying to output the count of total registrations today, registrations in the last 7 days, last 30 days. All the other counts are output as expected. Except for registrations today. $...
2
votes
1answer
36 views

Create dynamic sub-domain as per username in Laravel

I'm creating web application which needs dynamic domain per user. Let say I've 5 users in my DB such as. 1) wanda 2) edward 3) rick 4) maurice 5) kristin Now I've a domain as example.com. I want ...
0
votes
2answers
28 views

How to match and replace one array values to another array keys if they both start with the same letters?

I have two arrays: $array_one = array('AA','BB','CC'); And: $replacement_keys = array ( ""=>null, "BFC"=>'john', "ASD"=>'sara', "CSD"=>'garry' ); So far I've tried array_combine ...
1
vote
1answer
17 views

How to pass data from partial page to main laravel master pages?

I have made my navigation file a partial file because it is commonly needed in every pages. In navigation bar there are lists of categories displayed. When i click one of the categories, i want to it ...
1
vote
3answers
48 views

laravel 5.8: show empty fields to a new user in profile page

I am setting up profile section. I want to show empty fields to a new user. First I tried this, but it didn't work because new user's profile table is empty. <li>Name :<br> <p&...
1
vote
1answer
18 views

Need to create sub-domain type of url based on username

I am posting this question after struggling for 2 weeks on this.I am working on a Laravel project and I am stuck with a feature which I need to have on the project. Actually I want to have dynamic ...
-2
votes
2answers
46 views

How to fix SQL syntax error with Laravel?

enter image description hereI make controller about input data Combobox, and I input data appear SQL syntax error. how to fix the error? I have tried to fix, name of column database is id_makanan, ...
-2
votes
2answers
46 views

Call to a member function details() on null when assign model?

Use model is: public function details() { return $this->hasOne(UserDetails::class, 'user_id', 'id'); } First I create user model: $user = User::create([ 'email' => $...
0
votes
0answers
19 views

Model in laravel

How to fix this error: SQLSTATE[HY000] [2002] No connection could be made because the target machine actively refused it. SQL: insert into `developers` (`name`, `dept`, `updated_at`, `...
2
votes
1answer
34 views

Lazy eager loaded relationship missing in toArray()

Laravel 5.8 I am lazy loading an user with the related customer which has a one-to-one-relation with a crmaccount-object The models are working so that when i retrieve the eager-loaded entity it ...
-4
votes
0answers
14 views

i am trying to make api in laravel to add in cart. How should be the structure of api to do that?

Suppose the cart(client_id,item id and quantity) is the field in database. Can you tell me how should be the routes in api as well as controller???
0
votes
0answers
14 views

Laravel session flash data always null

I can't flash data to the Laravel session. In my view, data is always null. I am using Laravel 5.8.35. I tried this solution but it changed nothing. In my controller : public function addMembers(...
0
votes
0answers
6 views

Retrieve serialize value from database in laravel

I am creating referral system . Every thing is ok, but I am unable to retrieve serialize value from database. Here is my middle-ware code. public function handle($request, Closure $next) { ...
1
vote
0answers
23 views

How to compare two statistic data array dynamically?

right now I want to create a function to compare between two data statistics which is called as statisticsComparator and it will accept 2 parameters which is the left_stat and right_stat. Those keys ...
0
votes
0answers
16 views

getting database value to ckeditor using angularjs

I am updating question which is having 4 options, each option have ckeditor. At the time of displaying details i can not able to display options in ckeditor. But the background operations, means ...
1
vote
3answers
35 views

Laravel - Compare arrays and update if data was different

Here's the flow: I select up to 5 students in a listing and click the "Generate Training" button. Then I record in the session an array of the selected students. In the next screen I retrieve this ...
0
votes
0answers
5 views

Error in laravel excel export - touch(): Unable to create file /var/folders/ because Permission denied

I install larvel excel and when i try to get the excel it shows the following error touch(): Unable to create file /var/folders/wg/vbj_bbf14gl7glz__j1xpvg40000gn/T/laravel-excel-...
0
votes
1answer
35 views

How to make vue-router mode history work with laravel routes

I currently have a SPA using Vuejs VueRouter and Laravel. What I am trying to do is to make the experience as smooth as possible for the user. I have laravel routes as well as vue routes defined. The ...
1
vote
1answer
32 views

Laravel Not able to dispatch job from crontab

if i use this code in a controller queuing works well $job=(new ReProcessShipment($single_data->request_data))->delay(2); $this->dispatch($job); but using same code in crontab error ...
0
votes
0answers
10 views

How to display flipbook made using turn.js as an overlay popup

I have made a flipbook using turn.js(The basic sample). It is working completely fine when viewed in a browser. But I want to display it on my laravel website as an overlay popup that appears as soon ...
1
vote
1answer
22 views

Laravel Queue not able to convert class object to string

The Issue is when I pass long encoded string as parameter to create object of a class I get error here is my code below:- $job=new ReProcessShipment("...
1
vote
1answer
53 views

Laravel set option to selected if option id is in an array list in blade view

I made query in my controller and send it to my blade : public function editContractorAssociation(DeveloperContractorAssociation $developer_contractor_association, Request $request) { $id ...
2
votes
6answers
57 views

Laravel5.8 I cannot store data to my sql server

I am setting up user profile page, but I cannot insert data into mysql server. I cannot figure it out and solve this issue. I have index.blade.php in my profile folder, and from index page, going to ...
0
votes
1answer
25 views

Class 'Collective\Html\HtmlServiceProvider' not found and other Class encrypter does not exist

After adding aliases and the laravelcollective/html service provider, I'm getting an error.
0
votes
1answer
14 views

Run schedule every five minutes (like 00:05, 00:10…) in laravel

I want to run the schedule every five minutes. like 12:00, 12:05, 12:10...n I'm using the Schedule Frequency Options : ->everyFiveMinutes(); But sometime it will start 12:02, 12:07, 12:12...n It'...
1
vote
2answers
53 views

Laravel query in blade view

How do you translate this query in blade.php $developer_contractor_association = DeveloperContractorAssociation::whereHas('defect_types', function ($query) use($id) { $query->where('...
1
vote
1answer
18 views

How with $faker->word get unique value?

In laravel 5.8 app I make tests and adding new user for any tests I encountered that line $loggedUser= factory(User::class)->create(); raise error : Doctrine\DBAL\Driver\PDOException: SQLSTATE[...
0
votes
0answers
21 views

customize “can” function in laravel

how i can customize @can function in laravel? i want revoke specific permission from user by not delete permission from permissions table. the users that have admin group can create users and give ...
0
votes
3answers
34 views

Laravel Eloquent Model query with custom select/join/order

I have models called Post, and PostView. A Post can have many PostViews. I need to get a paginated list of Posts ordered by the count of PostViews created within the last 30 days. I can do this ...
0
votes
2answers
43 views

Laravel5.8: The GET method is not supported for this route. Supported methods: POST. issue

I am setting user profile update section. But when I went to profile create page, I got a following error. The GET method is not supported for this route. Supported methods: POST. I tried php ...
-2
votes
0answers
22 views

How to create mutiple id with display to single view file like OLX wqebsite

I am using laravel framework and working on a project like OLX. Project have option for sell same like OLX sell button. My question is how I can create multiple ID with single view form. For Ex. ...
0
votes
2answers
60 views

Calculate hours for training

I have some hesitations about 3 tables which are type_training , training & payment. In the table type_training, I have a field named price with 4 amounts: for example: 1 hour 00 = 100 euros ...
0
votes
2answers
30 views

How to customize working hours for a project in Laravel [on hold]

I am working on a project with Laravel in which I have to add the working hours for an office for example one branch office works from monday to friday and other branch office from the same company ...
-4
votes
0answers
23 views

how to add a checkbox to the data that is already stored [on hold]

I want to add the participant to the exam schedule, and compile the participant's name into the schedule so the participant has a checklist. How to allow marking the checklist for registered ...
1
vote
1answer
33 views

Laravel - How to load a hasone relation on a hasmany relation

I'm trying to load a hasone relation on a loaded hasmany relation. Basically, I have loaded my completion logs, but would like to also load the pool_section model relation for each of the loaded ...