vendredi 24 août 2018

Laravel - How to replace a string in database

i have a blog website. I change my brand name. So i need to change all blog posts that include my brand name.

i can find them like :

$search = 'old-brand-name';
$posts = \App\Models\BlogPost::where('description', 'LIKE', '%'.$search.'%')->get();

But i have to replace these strings in database level with my new brand name. How i can do it ?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2BHHnwP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire