1/** in migrations this changes need to
2 add for table we want to add soft delete (LARAVEL)*/
3
4 /** The migrations. START */
5 public function up()
6 {
7 Schema::table('users', function(Blueprint $table)
8 {
9 $table->softDeletes();
10 });
11 }
12 /** The migrations. END */
13
14 /** after adding softdelete you need to
15 point that column in table related model (LARAVEL)*/
16
17 /** The Model. START */
18 use Illuminate\Database\Eloquent\SoftDeletes;
19 class User extends Model {
20 use SoftDeletes;
21 protected $dates = ['deleted_at'];
22 }
23 /** The Model. END */
1$collection = collect([
2 ['product' => 'Desk', 'price' => 200],
3 ['product' => 'Chair', 'price' => 100],
4 ['product' => 'Bookcase', 'price' => 150],
5 ['product' => 'Door', 'price' => 100],
6]);
7
8$filtered = $collection->where('price', 100);
9
10$filtered->all();
11
12/*
13 [
14 ['product' => 'Chair', 'price' => 100],
15 ['product' => 'Door', 'price' => 100],
16 ]
17*/
1$collection = collect(['name' => 'taylor', 'framework' => 'laravel']);
2
3$value = $collection->get('name');
4
5// taylor
1$userData = array('username' => 'Me', 'email' => 'me@yahoo.com');
2User::create($userData);
3