Laravel 4 - Meaning of "Migration"?

I need some advice.

I have several migration files in my setup.

In some of them, I see the following code, which arent otherwise, and im not sure if its for

use Illuminate\Database\Schema\Blueprint; Schema::create('brand', function(Blueprint $table) 

Can someone tell me what the drawing lines are for? since they arent in other creating tabular migrations.

thanks

+4
source share
1 answer

This is because in your close, the $table parameter is marked as a Blueprint object. Indeed, every time a Blueprint is passed to the Schema::create closure. Thus, you can restrict the Blueprint parameter, and then PHP throws a fatal error if an object of another type is passed, or you can leave it empty so that PHP does not check the passed object.

Just find files that do not have use -Statement missing. There will be no parameter limitation.

+6
source

Source: https://habr.com/ru/post/1495929/


All Articles