Questions tagged [laravel-5.6]

Laravel 5.6 is a previous version of the open-source PHP web framework created by Taylor Otwell. It was released on February 7, 2018. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.6. Use the Laravel tag for general Laravel related questions.

Laravel 5.6 is a previous version of Laravel 5. It was released on February 7, 2018.

What is new:

  • Logging Improvements
  • Single Server Task Scheduling
  • Dynamic Rate Limiting
  • Broadcast Channel Classes
  • Model Serialization Improvements
  • Argon2 Password Hashing
  • Collision (Pretty CLI Output)
  • Bootstrap 4

Resources:

1859 questions
14
votes
4 answers

Laravel drop foreign Key in Migration

I want to create a Migration which shall drop a table. I created the Migration like this: Schema::table('devices', function (Blueprint $table) { $table->increments('id'); $table->unsignedInteger('client_id')->nullable(); …
Jon not doe xx
  • 533
  • 3
  • 10
  • 20
14
votes
4 answers

How to insert big data on the laravel?

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…
moses toh
  • 12,344
  • 71
  • 243
  • 443
14
votes
9 answers

php - Unknown: Failed opening required on line 0. laravel 5.6

I just installed laracast/flash and updated nesbot/carbon via composer. The cmd went nuts while downloading carbon. Cmd interface displayed scattered words and boxes all over the interface for a while and the download was completed. Did php artisan…
Angnima Sherpa
  • 224
  • 1
  • 2
  • 11
14
votes
3 answers

Laravel Cannot Access Image Stored in Storage Folder after Uploading in Server

I am trying to upload and retrieve image in my Laravel project. It worked perfectly in my local server, but after uploading in live server, its not working. I am using nginx. I have tried php artisan storage:link but it says The "public/storage"…
Ahsan
  • 1,289
  • 3
  • 13
  • 37
13
votes
5 answers

How to validate input data using ajax in laravel

testAjax function inside PostsController class: public function testAjax(Request $request) { $name = $request->input('name'); $validator = Validator::make($request->all(), ['name' => 'required']); if ($validator->fails()){ …
RajB009
  • 417
  • 2
  • 7
  • 19
12
votes
3 answers

Laravel 5.8 How to get the job Id?

I'm trying to get the job ID inside my jobs. I try $this->job->getJobId() but it returns an empty string.
Kenneth
  • 2,813
  • 3
  • 22
  • 46
12
votes
2 answers

Laravel 5.6 Polymorphic relation with whereHas

I am facing an issues in Polymorphic relation where I can not make whereHas to work. Basically I have a "where" condition which i want to apply. The relation code is working fine to return the related models but it returns errors once applying the…
12
votes
4 answers

Laravel - Reusable resource controller

I am modifying the CMS that I use in my projects, and recently I decided to create a controller for default actions BaseController, where all other controllers will extend this controller BaseController.
Caio Kawasaki
  • 2,894
  • 6
  • 33
  • 69
12
votes
4 answers

Inform user that message is still being typed

I am using Laravel 5.6.7, Socket.IO and vue.js. I am not using Pusher and redis. Below is my code to send message to user chatting with me one to one. var url = "http://localhost:6001/apps/My_appId/events?auth_key=My_Key"; var socketId =…
Pankaj
  • 9,749
  • 32
  • 139
  • 283
12
votes
1 answer

Laravel 5.6 Testing File Uploads (Unable to find a file at path [file.txt])

I am new to laravel, I can run successfully my file uploader, it uploads successfully my file, but the unit test fails, here is my code: UploadTest.php public function testUploadFile() { $fileSize = 1024; // 1mb $fileName = 'file.txt'; …
Nickan
  • 313
  • 2
  • 11
11
votes
3 answers

Laravel class access in Vue.js

I have the following class where I defined my Minimum/Maximum length values: class MinMaxValuesUser { const Min_UserName = 6; const Max_UserName = 30; } Below is the rule in request class where the min max values are used instead of…
Pankaj
  • 9,749
  • 32
  • 139
  • 283
11
votes
3 answers

Upgrade Laravel 5.6 to 5.7

I want to upgrade Laravel to 5.7 because I need new features, but I can't find any easy way. I followed these steps:-Upgrading Laravel Version but I found an error during composer update I got this error and I also tried to solve the solution but…
Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
10
votes
1 answer

How to fix "Cross-Origin Read Blocking (CORB) blocked cross-origin response with MIME type application/json." issue?

I'm currently developing the frontend (VueJS) for a project and to test my login and register logics I'm using laravel as backend, though we'll be actually working with springboot for backend. I was coding in a desktop and everything was normal. So…
Thalys Menezes
  • 345
  • 1
  • 4
  • 17
10
votes
6 answers

Laravel Failed to authenticate on SMTP server with username

Am trying to send email by Laravel. But It's getting error. .env file Configuration below : MAIL_DRIVER=smtp MAIL_HOST=smtp.gmail.com MAIL_PORT=587 MAIL_USERNAME=myemailID@gmail.com MAIL_PASSWORD=****** MAIL_ENCRYPTION=tls Controller Code Below : …
Ripon Uddin
  • 709
  • 3
  • 14
  • 29
10
votes
3 answers

Laravel - How to convert API Resource to array recursively?

I'm using Laravel API Resource and want to convert all parts of my instance to an array. In my PreorderResource.php: /** * Transform the resource into an array. * * @param \Illuminate\Http\Request * @return array */ public function…