Ad

Laravel Schema::drop($table) Return Value

I was just wondering if I use drop() method in Laravel Eloquent like say,

    Schema::drop('users')

what will be the return value of it ? Though I can use hasTable() method after drop() method to check table existence but I was just wondering if we can get it directly from return value ?

In laravel api Blueprintclass I can see it's mentioned as Return Value - Fluent. But I don't know what is the meaning of it ? Can anyone help ?

Thanks in advance,

Sambhav

Ad

Answer

You can look at Illuminate\Database\Schema\Builder.php source. As you see:

public function drop($table)
{
        $blueprint = $this->createBlueprint($table);

        $blueprint->drop();

        $this->build($blueprint);
}

doesn't return any value.

The question is what you want to check. If drop is successful nothing happens and in case of any error, probably Exception will be thrown.

Ad
source: stackoverflow.com
Ad