Questions tagged [laravel]

Laravel is an open-source PHP web framework, following the MVC pattern.

0
votes
0answers
16 views

I Need to Show Data as Option of Different DB Table

I'm using Laravel 5.7 & VueJs 2.5.*.I am building an invoice application. I have a table of Vendors and need to show all Vendors in my create Invoice form (e.g This invoice is related to the ...
0
votes
0answers
10 views

how to implement DRM on videos and audio files in Laravel 5.5?

I need to implement DRM on audio/video files, I m working on laravel 5.5. Please provide some guidance.
0
votes
0answers
12 views

Docker web server (nginx + php5.6) not update when code change

I pull an images from docker hub and run a container from that image by command: docker run -d -p 8081:80 -v /Users/nguyenphong/Documents/tiki/fulfillment:/src --name fulfillment tala/nginx-php ...
0
votes
0answers
18 views

Wrong View create PDF laravel

On a button click I want a PDF. But I dont get a PDF I just get the data from the database. My code is: <?php namespace MVS\Http\Controllers; use Illuminate\Http\Request; use DB; use PDF; use ...
1
vote
2answers
35 views

Unable to do Ajax request in Laravel/Vue.Js

So i've gotten to the point where im starting to bang my head against the wall with this issue, i have tried googling for a solution but all pages simply say "Include the CSRF token", which i have ...
0
votes
0answers
20 views

how to fix ERR_CONNECTION_TIMED_OUT error in xampp virtual host

Hello i'm host a site on VPS using xampp virtual host..and it enable for public access through the fire wall...site is working properly...but some time it cannot working...display bellow error. This ...
0
votes
1answer
20 views

Resource not found!! Laravel 5.7

I have in my web.php the following routes: Route::get('admin', ['as' => 'admin.login', 'uses' => 'AdminController@login']); Route::post('admin', ['as' => 'admin.postLogin', 'uses' => '...
0
votes
2answers
27 views

Laravel Controller -> API class

I'm struggling with how to do this correctly following best practices. It might be difficult to explain but i'll try my best here. I have an external API I need to make very many different calls to. ...
0
votes
1answer
33 views

Laravel: relations on same table

In my application I have a users table, in this table there is a field called managedByUsername which is the username of that particular user's manager. To get your employees specifically you could ...
0
votes
1answer
19 views

How to add validation custom messages with array items rules when validating array in Laravel?

I've custom validation code: $this->validate($request, [ 'array' => 'required|array|max:100', 'array.*' => 'required|string|distinct|min:3' ], [ 'array.max' => 'Array can't ...
0
votes
0answers
8 views

Laravel Nova, change search results HTML

I have a simple Nova integration like this : I want somehow to make the Name field to be an anchor. So, to make it a link the same way that view button does. Any ideas? (Nothing on docs)
1
vote
0answers
11 views

Laravel Spark Use Case

I have a project where Laravel Spark feels like the perfect starting point. I have searched Google for some examples of use cases but as yet have not found any so thought I would ask here. I am at ...
0
votes
0answers
11 views

Can I use Laravel Mix on a project that already uses Gulp?

Bit of a "first steps" question this one. I am working on a project that uses gulp, and have found a nice vue component that I would like to incorporate. I have been recommended to use Laravel mix, ...
0
votes
1answer
15 views

Simple_Dom Error: file_get_contents(): stream does not support seeking in Laravel

I'm getting a error as below. file_get_contents(): stream does not support seeking I installed simple_dom by a composer: composer require sunra/php-simple-html-dom-parser and used this too: ...
0
votes
1answer
32 views

Extending DB facade Laravel

I would like to convert a timestamp and have some other values related to it. My question is how I can introduce my own method like DB::raw() that appends everything to the current select values. So, ...
0
votes
0answers
16 views

Save big array in Laravel cache

I am trying to save arrays in Laravel cache. It works perfectly for small arrays, but has trouble for big arrays (my machine stops working). For example array with 5000 rows and 7 column. Estimated ...
0
votes
0answers
13 views

Return a View with a Variable in laravel using vsmoraes/laravel-pdf package

I'm in need of printing data from the database using the vsmoraes/laravel-pdf package but can't be able to pass on the data into a view. This is my function in the controller public function print($...
1
vote
1answer
14 views

Select SUM from subquery while using whereHas in Laravel

I have 2 tables, customers and customer_invoices, and I want to get all the customers with a condition on their invoices, and select specific columns (customers.id, customers.last_name, and the sum of ...
0
votes
0answers
13 views

Authentication user provider [passport] is not defined with laravel passport

I have an api in laravel and im using passport to authenticate. On my config/auth.php file i have changed this so the api guard using passport and refers to my user provider 'guards' => [ '...
0
votes
2answers
44 views

How to split up the value as an array

How to split up the value to an array. I have the whmcs api data it looks like 1,2,3,4,5. I need to split up the value to an array value suggest any solution My api data Array ( [result] => ...
0
votes
1answer
26 views

Edit user laravel using Vue

I have a modal component and a users component which has all the users in an HTML table. I decided to use modal to edit the user. I've added the modal and linked a button to each user in the v-for ...
-2
votes
1answer
23 views

How to create laravel customize relationship in model?

ex. one agent table in primary id is agent_id, not id and the second table is agent_bio_data table in primary id is bio_id and foreign key is agent_id that time what can i do for creating both tables ...
-1
votes
0answers
25 views

How to redirect HTTPS to HTTP for one pages in laravel

I want to redirect https to http for one page only,, the url is https://global.xx.my/moaqs to http://global.xx.my/moaqs i use , but didnt work RewriteEngine on RewriteCond %{HTTP} off RewriteRule ...
-1
votes
0answers
14 views

fputcsv not recording all results

I have the following code that is supposed to pull specific data from the database and export it to a csv, the issue is that it is not outputting all results. <?php namespaceAppHttpControllers; ...
0
votes
0answers
41 views

Bootstrap datepicker shows incorrect date format

I use bootstrap datepicker to get a date input to my HTML page. I get the current date from the back end by Laravel code as $currentDate. HTML: <input type="text" name="manifest-date" class="...
0
votes
1answer
35 views

How to access a model from view without using the foreach loop

I was trying to create a view where I can access the data one by one like I have a model of questions and want to show each question on a separate page or at least I want to have the control how each ...
-11
votes
0answers
41 views

How to loop all the values and validate with current date using php [on hold]

how to loop and validate fields with current date with the fields start date. All the dates should be fine then only I'll return true looping problem is here. { "time_id": 1, "user_details": [...
0
votes
2answers
27 views

show data name which one project with user use laravel

I want to display User Name who have one project with user logged in. use relation table user_id and project_id in UserProject as table pivot. my index controller public function index() { $...
0
votes
3answers
34 views

Laravel Relations and Foreign Key Constraints

I have two models and migrations tables. <?php namespace App; use Illuminate\Database\Eloquent\Model; class Room extends Model { public function guest() { return $this->...
0
votes
1answer
23 views

sending file with other post data using advanced rest client?

I've been trying to send file with other post data which is mentioned in picture below also whenever i execute it, i only receive file but not other post data, it says "null" :- Screenshot Do i ...
0
votes
1answer
26 views

JS Library not loading on Laravel

I have installed list.js within my application on laravel. I am trying to follow the best practice while working on laravel but I am a bit new on it! I did it trough npm install list.js & then ...
0
votes
2answers
33 views

How to allow route parameter to use / or - in laravel 5.5

For a sample link, https://ddskart.com/product/COPIER%20TONER/NP-6/7/8000/71 How do I construct a GET route ? the route must follow the given format. Route::get('product/{category}/{model}/{...
1
vote
0answers
18 views

How to remove attribute within a MongoDb json when using Laravel

I wanted to fix some things in my MongoDb and I needed to add attributes fast. I did this, fast, using the add method. Now, I want to fix and remove some attributes. As you can see, by using isset($...
2
votes
2answers
30 views

How can I create my own functions in October CMS?

The "global" means functions that I can call everywhere on pages and layouts without repeating them on every place where I should use them
0
votes
2answers
27 views

Memory error while running the composer update

Error: Updating vlucas/phpdotenv (v2.4.0 => v2.5.1): The following exception is caused by a lack of memory or swap, or not having swap configured Check https://getcomposer.org/doc/articles/...
0
votes
1answer
43 views

Delaying PHP code for some time when reaching out to a Payment Gateway

I am working on a Laravel PHP project whereby I reach out to an Payment API to check the status if the user has paid and redirect the user to a payment-confirm page. By default the payment status ...
0
votes
3answers
57 views

How to save multiple row forms in laravel using ajax?

Hey guys I'm a bit confused with this. How do I input multi row forms in Laravel 5.5 using ajax? The idea is to add items and when adding items the Item number increments, then I want to save this ...
0
votes
3answers
21 views

Login auth for existing user not working correct for existing and non existing user in laravel

I am working on login panel with custom login after successfull user registeration with in table while trying to login after validating email and password in correct format it unabling to check auth ...
2
votes
1answer
27 views

Laravel Uncaught TypeError: Cannot read property 'addEventListener' of null

I am getting this error in console Uncaught TypeError: Cannot read property 'addEventListener' of null, i'm using Laravel 5.7, here is my code of @section(): @section('scripts') <script type="...
0
votes
2answers
40 views

did not route page to payment blade file in laravel 5.6

in My laravel 5.6 app I have following route link to payment.blade.php file in payments view files, <a class="btn btn-primary" href="{{route('payments.payment',$vehicles->id)}}" role="button"&...
0
votes
1answer
37 views

is there any way to change php version for specific file not directory?

i have a php 7 laravel website and a lot of APIs are written in php 5.6 and these APIs are in main directory, i also wanna put website in main directory, so is there any way to change php version for ...
0
votes
0answers
31 views

How to add pagination in relationships?

I want to add paginate to my relation but i got some errors method paginate does not exist, my code look like this public function detail($slug) { $merchants = Merchant::where('slug', $slug)->...
1
vote
2answers
32 views

How to check id which I used from a table that related with other multiple table?

When I want to delete a row from table I want to check the tables which use the id of this row. If used then it doesn't allow to delete.
-1
votes
2answers
22 views

Call to protected method App\Http\Middleware\Admin::handle() from context 'Illuminate\Pipeline\Pipeline'

i am really new to Laravel. I try to create page by follow some youtube tutorial. It goes fine suddenly there got error in call to protect method from context pipeline. I try to search in ...
1
vote
1answer
33 views

Laravel array_push

This is my data: $dataItems = [ [ 'id' => 1, 'serial' => "XXXXXXAA1", 'pd_item_info' => [ 'id' => 1, 'quantity' => 5, ...
0
votes
1answer
21 views

Determine the layout per user level/role on Laravel 5.7

Good day I have 3 differentes levels/roles in my project admin employment customer I want to determine the layout for one page depending on the level, this is my code, I use Auth::user @if(Auth::...
0
votes
1answer
11 views

How to mock authentication user on unit tests with Codeception in Laravel 5?

I have to convert my unit tests to codeception. I need to use loginWithFakeUser() function from this article - How to mock authentication user on unit test in Laravel? public function ...
1
vote
4answers
41 views

In Laravel, how to send data from the view to the controller using paginate

I have a view to show fields that are completed by the user. <tbody> @foreach($indicadores as $ind) <tr> <td id="{{$ind->id}}">{{ $ind->...
-1
votes
0answers
16 views

Laravel session lifetime is not synced with PHP Session [duplicate]

I'm coding this Ecommerce Website based on Laravel framework. And it seems that Laravel has its own session storage apart from PHP sessions'. Because of this, I logged into my customer account (...
0
votes
2answers
19 views

Laravel Collection: How to access object of object?

This is my query: $productItems = ProductItemResource::collection(ProductItem::where('pd_id', $id)->get()); The output of query is this: $output = [[ 'id' => 1, '...