Questions tagged [laravel-5.3]

Laravel 5.3 is a past version of the open-source Model-View-Controller framework for PHP created by Taylor Otwell. It was released on August 23, 2016. Use it in addition to the laravel-5 tag if your question is specific to Laravel 5.3. Use the laravel tag for general laravel related questions.

Laravel 5.3 is a past version of the open-source Model-View-Controller framework for PHP created by Taylor Otwell. It was released on August 23, 2016.

What is new:

  • Notifications
  • WebSockets / Event Broadcasting
  • Laravel Passport (OAuth2 Server)
  • Search (Laravel Scout)
  • Mailable Objects
  • Storing Uploaded Files
  • Webpack & Laravel Elixir
  • Frontend Structure
  • Routes Files
  • Closure Console Commands
  • The $loop Variable

Resources:

4266 questions
40
votes
3 answers

How to remove duplicates in collection?

I have collection in Laravel: Collection {#450 ▼ #items: array:2 [▼ 0 => Announcement {#533 ▶} 1 => Announcement {#553 ▶} ] } It is the same items. How ti delete one of them? Full code is: public function announcements() { …
Blablacar
  • 583
  • 1
  • 5
  • 16
40
votes
1 answer

Laravel 5.3 withCount() nested relation

The model structure is as follows Tutorial -> (hasMany) Chapters -> (hasMany) videos How can we load number of videos (video_count) from Tutorial Model with laravel 5.3's withCount() method I have…
Sahil Deliwala
  • 802
  • 1
  • 7
  • 14
39
votes
4 answers

Call to undefined method Illuminate\Database\Query\Builder::lists() when seeding after updating to Laravel 5.3

I'm updating to laravel 5.3, and I get this message: [2016-08-23 23:12:39] local.ERROR: BadMethodCallException: Call to undefined method Illuminate\Database\Query\Builder::lists() in…
Juliatzin
  • 18,455
  • 40
  • 166
  • 325
37
votes
6 answers

How to pass laravel CSRF token value to vue

I have this form where the user should only type text inside a text area:
{{-- Name of the method in Vue.js --}}
Pathros
  • 10,042
  • 20
  • 90
  • 156
37
votes
6 answers

Laravel Passport Scopes

I am a bit confused on the laravel scopes part. I have a user model and table. How can I assign a user the role of user, customer and/or admin. I have a SPA with vue and laravel api backend. I use…
36
votes
7 answers

Laravel 5.3 - How to log all queries on a page?

My team and I are working on a rather big project. There's queries going on everywhere - in controllers, in view composers in views (lazy loading) and probably in some other services as well. It's getting hard to keep a track of it all and the page…
DevK
  • 9,597
  • 2
  • 26
  • 48
36
votes
6 answers

Laravel 5.3 Storage::put creates a directory with the file name

I'm using Laravel's file storage functionality to save a file: public function dataPost(Request $request) { $fileInForm = 'doc'; if ($request->hasFile($fileInForm)) { $file = $request->file($fileInForm); if…
zundi
  • 2,361
  • 1
  • 28
  • 45
36
votes
1 answer

Laravel Echo - default.a.channel is not a function

I'm trying to setup Laravel Echo with pusher, to implement real time notifications. First, i have installed Laravel Echo and Pusher: npm install --save laravel-echo pusher-js After this, in bootstrap.js i have uncomment the code (as guide…
Mistre83
  • 2,677
  • 6
  • 40
  • 77
33
votes
12 answers

Laravel 5.4: how to delete a file stored in storage/app

I want to delete a file that is stored in storage/app/myfolder/file.jpg. I have tried the following codes but none of this works: use File $file_path = url().'/storage/app/jobseekers_cvs/'.$filename; unlink($file_path); and use File $file_path…
Ajmal Razeel
  • 1,663
  • 7
  • 27
  • 51
33
votes
5 answers

How to protect image from public view in Laravel 5?

I have installed Laravel 5.0 and have made Authentication. Everything is working just fine. My web site is only open for Authenticated members. The content inside is protected to Authenticated members only, but the images inside the site is not…
user4980957
32
votes
22 answers

Laravel Passport Password Grant - Client authentication failed

After hearing a lot about laravel passport, i thought of implementing it into my new project where my requirement is to create an API that'll be used in a mobile app. So my mobile app is a client, which will further have its users. I followed the…
Kanav
  • 2,695
  • 8
  • 34
  • 56
30
votes
6 answers

http://localhost:8000/broadcasting/auth 404 (Not Found)

I am trying to make my app app connect to pusher on a private channel. But I am getting the following error: pusher.js?b3eb:593 POST http://localhost:8000/broadcasting/auth 404 (Not Found) What maybe the cause of the error and how to resolve…
YaSh Chaudhary
  • 2,605
  • 8
  • 37
  • 74
29
votes
9 answers

Laravel Passport Route redirects to login page

I'm using Laravel 5.3 & Passport. When using Postman to test any route I have set in api.php file it always returns the login page. Here is an example of my testing route: Route::get('/getKey', function() { return…
Keith
  • 291
  • 1
  • 3
  • 6
29
votes
2 answers

Too many fillable fields in model Laravel?

I have around 200 fields in a table that are numbered: field_1 field_2 etc I tried to insert data in table: Result::insert($data); Where $data is multiple array: $data = [] = array("field_1" => 3); $data = [] = array("field_1" => 2); Can I set *…
Griboedov
  • 413
  • 1
  • 6
  • 12
29
votes
9 answers

Laravel 5.3 storage:link -> symlink(): Protocol error

I'm trying to run the following artisan command: php artisan storage:link I get this error: [ErrorException] symlink(): Protocol error Can you help me to solve this. This is my setup: Windows 10 using vagrant with Homestead (v0.5.0) box Ubuntu…
Elie Morin
  • 1,456
  • 3
  • 15
  • 35