Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created November 20, 2021 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/e29e3664a834f6ae9f187401cbee72e4 to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/e29e3664a834f6ae9f187401cbee72e4 to your computer and use it in GitHub Desktop.
<?php
use App\Models\Post;
use App\Enums\PostType;
Post::wherePostType(PostType::Project)->get()->toArray();
/**
array:2 [▼
0 => array:5 [▼
"id" => 3
"title" => "Nuevo proyecto"
"post_type" => "project"
]
1 => array:5 [▼
"id" => 4
"title" => "Nuevo proyecto 2"
"post_type" => "project"
]
]
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment