wip
This commit is contained in:
1 parent
30563ee98d
commit
622b37bb90
12 files changed
+56
-56
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProjektMerkmale extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'projekte_id',
|
||||
'code',
|
||||
'name',
|
||||
];
|
||||
|
||||
public static function getfreecode($projekte_id)
|
||||
{
|
||||
|
||||
$possible = range('a', 'j');
|
||||
|
||||
$have = static::getModel()::where('projekte_id', $projekte_id)->pluck('code')->toArray();
|
||||
|
||||
$left = array_diff($possible, $have);
|
||||
|
||||
return array_shift($left) ?? false;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user