Primer commit proyecto Laravel

This commit is contained in:
2026-02-05 11:10:09 -06:00
commit e4559106d4
2153 changed files with 210301 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
<?php
namespace App\Models;
use App\Models\Plantel;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
class Prospecto extends Model
{
protected $guarded = [];
public function plantelUsuarios(): BelongsToMany
{
return $this->belongsToMany(Plantel::class);
}
public function existe($plantelId): bool
{
return $this->plantelUsuarios()
->where('plantels.id', $plantelId)
->exists();
}
public function prospectos() : BelongsToMany
{
return $this->belongsToMany(User::class);
}
}