| Conditions | 1 |
| Paths | 1 |
| Total Lines | 27 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public function up() |
||
| 24 | { |
||
| 25 | Schema::create('events', function (Blueprint $table) { |
||
| 26 | $table->bigIncrements('id'); |
||
| 27 | $table->integer('userid')->nullable(); //??? in multitenant or distribution |
||
| 28 | |||
| 29 | // add event category ... |
||
| 30 | |||
| 31 | $table->unsignedBigInteger('categoryid')->nullable(); |
||
| 32 | $table->foreign('categoryid')->references('id')->on('event_categories'); |
||
|
|
|||
| 33 | |||
| 34 | $table->foreignId('categoryid') |
||
| 35 | ->constrained() |
||
| 36 | ->onUpdate('cascade') |
||
| 37 | ->onDelete('cascade'); |
||
| 38 | |||
| 39 | $table->string('name'); |
||
| 40 | $table->string('location', 225); |
||
| 41 | $table->integer('category'); |
||
| 42 | $table->string('city', 255); |
||
| 43 | $table->string('country', 255); |
||
| 44 | $table->text('description'); |
||
| 45 | $table->string('timezone')->default('(GMT+3:00) Nairobi'); |
||
| 46 | |||
| 47 | $table->timestamps(); |
||
| 48 | }); |
||
| 49 | } |
||
| 50 | |||
| 61 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: