Conditions | 1 |
Paths | 1 |
Total Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function up() |
||
10 | { |
||
11 | Schema::create('votes', function (Blueprint $table) { |
||
12 | $table->increments('id'); |
||
13 | |||
14 | $table->integer('amount'); |
||
15 | $table->morphs('voteable'); |
||
16 | |||
17 | $table->integer('user_id')->unsigned(); |
||
18 | $table->foreign('user_id')->references('id')->on('users'); |
||
|
|||
19 | |||
20 | $table->timestamps(); |
||
21 | }); |
||
22 | } |
||
23 | |||
29 |
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: