Posts

Jamie Foxx

Image
Esta página ou secção cita fontes confiáveis e independentes, mas que não cobrem todo o conteúdo, o que compromete a verificabilidade (desde dezembro de 2011) . Por favor, insira mais referências no texto. Material sem fontes poderá ser removido. — Encontre fontes: Google (notícias, livros e acadêmico) Esta página precisa ser reciclada de acordo com o livro de estilo (desde dezembro de 2011). Sinta-se livre para editá-la para que esta possa atingir um nível de qualidade superior. Jamie Foxx Foxx na première de Django Unchained em Janeiro de 2013. Nome completo Eric Marlon Bishop Nascimento 13 de dezembro de 1967 (51 anos) Terrell, TX , Estados Unidos Ocupação Ator Produtor Roteirista Cantor Comediante Oscares da Academia Melhor Ator 2005 - Ray Globos de Ouro Melhor Ator - Comédia ou Musical 2005 - Ray Prémios Screen Actors Guild Melhor Ator Principal 2005 - Ray Prémios BAFTA Melhor Ator 2005 - Ray P...

Laravel firstOrCreate without Eloquent

Image
0 Eloquent has a firstOrCreate method which gets a model based on a condition, or creates it if it doesn't exist. Is there any equivalent method in Laravel's query builder (i.e. NOT in Eloquent)? For example: $row = DB::table('users')->where('user_id', 5)->firstOrCreate('name' => 'Peter', 'last_name' => 'Pan'); That would try to get a row from users with 'user_id'==5 . If it doesn't exist, it would insert a row with that id number, plus the other mentioned fields. EDIT: I'm not trying to apply my question with users. I used users as an example to make as clear as possible what I'm looking for. laravel share | imp...