Skip to content

Tag: laravel

laravel seed rollback after seeding database

I have seeded my DB using php artisan db::seed. Is there a way to rollback what I have seeded into my DB? I cannot seem to find any command like php artisan db::seed rollback. Answer use Undo Seeder for Laravel. When you install UndoSeeder, the following artisan commands are made available: more Undo-Seeder

Laravel and Nginx static files

So I am having a problem with getting Nginx to serve static files for my Laravel app. I can see in chrome’s dev tools that the requests are being made to the path, where those files should be (http://…

PHP “with” keyword – what does “with” do?

Can someone please explain what PHP “with” does? Example begins: Say I have a class: Appfa_batch What is the difference between this statement: and this statement? Context / Background Info: I’m having trouble finding documentation for with, maybe because the PHP.net, stack overflow and goog…

Guzzle returns stream empty body instead of json body

When I use Postman to make an API call I receive a JSON object..which is what I expected. However When I make same call with Guzzle like so: I get dump below from Guzzle Answer getBody() returns a stream. If you want to get all the content at once you can use getContents() method and decode json while at it