CopyPastor

Detecting plagiarism made easy.

Score: 0.9884668253184502; Reported for: String similarity Open both answers

Possible Plagiarism

Plagiarized on 2020-02-24
by Sehdev

Original Post

Original - Posted on 2016-12-28
by Alexey Mezenin



            
Present in both answers; Present only in the new answer; Present only in the old answer;

When you're using `get()` you get a **collection**. In this case you need to iterate over it to get properties:
@foreach ($collection as $object) {{ $object->title }} @endforeach
Or you could just get one of objects by it's index:
{{ $collection[0]->title }}
Or get first object from collection:
{{ $collection->first() }}
When you're using `find()` or `first()` you get an **object**, so you can get properties with simple:
{{ $object->title }}
Reference: https://stackoverflow.com/questions/41366092/property-title-does-not-exist-on-this-collection-instance
When you're using `get()` you get a **collection**. In this case you need to iterate over it to get properties:
@foreach ($collection as $object) {{ $object->title }} @endforeach
Or you could just get one of objects by it's index:
{{ $collection[0]->title }}
Or get first object from collection:
{{ $collection->first() }}
When you're using `find()` or `first()` you get an **object**, so you can get properties with simple:
{{ $object->title }}

        
Present in both answers; Present only in the new answer; Present only in the old answer;