laravel-5.6

How to insert big data on the laravel?

我的梦境 提交于 2019-12-12 07:07:28
问题 I am using laravel 5.6 My script to insert big data is like this : ... $insert_data = []; foreach ($json['value'] as $value) { $posting_date = Carbon::parse($value['Posting_Date']); $posting_date = $posting_date->format('Y-m-d'); $data = [ 'item_no' => $value['Item_No'], 'entry_no' => $value['Entry_No'], 'document_no' => $value['Document_No'], 'posting_date' => $posting_date, .... ]; $insert_data[] = $data; } \DB::table('items_details')->insert($insert_data); I have tried to insert 100 record

FatalThrowableError:Argument 1 passed ..::fromUser() laravel 5.6

孤街浪徒 提交于 2019-12-11 17:39:48
问题 I use postman to add user or to login , user has added with sucess but I get this error "Argument 1 passed to Tymon\JWTAuth\JWT::fromUser() must be an instance of Tymon\JWTAuth\Contracts\JWTSubject, instance of App\User given, called in C:\Users\Web WorkStation\Desktop\laravelapp\jwtlaravel\vendor\tymon\jwt-auth\src\JWTAuth.php on line 54" and I found in this ligne this founction public function attempt(array $credentials) { if (! $this->auth->byCredentials($credentials)) { return false; }

Error while implementing vue2-google-maps in vue.js and Laravel 5.6.12

。_饼干妹妹 提交于 2019-12-11 17:29:13
问题 I am using Laravel 5.6.12 and vue.js I am implementtrying to implement Google Maps with the help of this github link I following the guidelines mentioned in above link as below. Installation npm install vue2-google-maps Then wrote below code in app.js import * as VueGoogleMaps from 'vue2-google-maps' Vue.component('vue2-google-maps', VueGoogleMaps); Finally below code in the template <GmapMap :center="{lat:10, lng:10}" :zoom="7" map-type-id="terrain" style="width: 500px; height: 300px" ><

Why `having` only worked on fields that are `group by` on laravel eloquent?

二次信任 提交于 2019-12-11 17:11:43
问题 My script laravel eloquent like this : $query = $this->item->select('a.*','b.attribute_code') ->from('items as a') ->join('attr_maps as b','b.number','=','a.number') ->groupBy('a.number'); foreach($param as $key => $value) { $query = $query->having($key, '=', $value); } $query = $query->paginate(10); My $param is dynamic. It can change If $param is array('number'=>'1234') , it works. No error If $param is array('description'=>'test') , there exist error : Unknown column 'description' in

Laravel + NGINX giving 403 forbidden

≡放荡痞女 提交于 2019-12-11 15:58:16
问题 I am really stuck loading a Laravel app for the first time on the web (EC2). I have an instance of Ubuntu 18.04 running latest laravel 5.6. I have been stuck for hours trying to resolve a 403 issue. I have followed: These steps (create new group, add ubuntu and www-data to it, set group and owner to read, write and execute) These steps to set folder permissions ... many other attempts / server rebuilds... So just now I set all files and folders in root to 777 to test $ find /home/ubuntu

Google Reference Error after installing vue-google-autocomplete

一曲冷凌霜 提交于 2019-12-11 15:46:39
问题 I am using vue.js and Laravel 5.6.12 I am following this github page to install vue.js google autocomplete. Below is the Step by Step guidelines I followed. npm install vue-google-autocomplete --save Then added below code in app.js import VueGoogleAutocomplete from 'vue-google-autocomplete' Vue.component('vue-google-autocomplete', VueGoogleAutocomplete); Finally below code in the template. <vue-google-autocomplete id="map" classname="form-control" placeholder="Start typing"> </vue-google

How can I pass parameter using dynamic breadcrums laravel?

馋奶兔 提交于 2019-12-11 15:19:35
问题 My breadcrumbs view like this : Home / Dashboard / Summary / Summary Detail If link summary detail is active, the url link like this : http://my-app.test/admin/summary-detail?item_number=123&vendor_code=V123&from_date=2018-01-01&to_date=2018-08-01 If I click link summary, the url like this : http://my-app.test/admin/summary I want if I click link summary, it will get all parameter from summary detail. So I want the url like this : http://my-app.test/admin/summary?item_number=123&vendor_code

Laravel-5.6 'LIKE' in where select

折月煮酒 提交于 2019-12-11 15:17:43
问题 I use this query and i get a error : $description = $request->get('description'); if (!empty($description)){ $description_query = Transcationhistorique::where(['sender_id' => $user_id, "%$description%", 'LIKE','description']) ->orWhere('receiver_id', $user_id)->get(); }else{ $description_query = "" ; } and this is the error that I get : "SQLSTATE[42S22]: Column not found: 1054 Unknown column '0' in 'where clause' (SQL: select * from transcation_historique where ( sender_id = 32 and 0 =

Pusher\Exception\HttpException Bad request

萝らか妹 提交于 2019-12-11 15:09:15
问题 laravel- 5.6 Php - 7.2 pusher - 3.0 when try to connect with pusher: 回答1: You should provide more details to your question so others have a better picture of what might cause the problem. But I ran into the exact same problem recently and might be able to help. In my instance, this problem is caused by composer pulling in pusher dev-lib instead of published version when I run composer require pusher/pusher-php-server "~3.0" . It happens because I don't have php-curl installed in my setup.

Laravel 5.6 Auth /admin showing blank page with or without login

人盡茶涼 提交于 2019-12-11 06:46:17
问题 I am new to Laravel and its 5.6 version. I setup a Auth login using few commands over there. All is good going. But when I uploaded to my own live server then when I run site.com/admin [that should be redirect to site.com/login for non login scene]. But I got a blank page. When I ran site.com.login then login page is working and I am in admin panel to work on. My question is that why my site.com/admin page is blank. all other pages are working fine. here is my files. routes/web.php Route::get