first commit

This commit is contained in:
2024-11-07 17:16:20 +02:00
commit 75e91e4ddc
152 changed files with 17270 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
<?php
namespace App\Http\Controllers;
abstract class Controller
{
//
}
+63
View File
@@ -0,0 +1,63 @@
<?php
namespace App\Livewire;
use Hive\Services\UserService;
use Illuminate\Support\Facades\App;
use Livewire\Component;
class AssignTo extends Component
{
private $queryResults = [];
public $query = "";
public $value = "";
private $selection = [];
public $display = "none";
public $simpleResult = "";
private $service;
function boot() {
$this->service = App::make(UserService::class);
}
function updated()
{
if (strlen($this->query) > 2) {
$this->display = "";
$this->queryResults = $this->service->search($this->query);
}
}
public function add($id)
{
if (!str_contains($this->value, $id)) {
$this->value .= $id . "|";
$this->selection[] = $this->service->getById($id);
}
}
public function remove($id)
{
if (str_contains($this->value, $id)) {
$this->value = str_replace($id . "|", "", $this->value);
$this->selection = collect($this->selection)->reject(function ($item) use ($id) {
return $item->id == $id;
});
}
}
public function render()
{
return view('livewire.assign-to', [
"queryResults" => $this->queryResults,
"simpleResult" => $this->simpleResult,
"selection" => $this->selection
]);
}
}
+22
View File
@@ -0,0 +1,22 @@
<?php
namespace App\Livewire;
use Livewire\Component;
use Livewire\Attributes\On;
class Trix extends Component
{
#[On('file-uploaded')]
function uploadAttachment($event)
{
dd($event);
dd(json_decode($event));
}
public function render()
{
return view('livewire.trix');
}
}
+48
View File
@@ -0,0 +1,48 @@
<?php
namespace App\Models;
// use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable
{
/** @use HasFactory<\Database\Factories\UserFactory> */
use HasFactory, Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array<int, string>
*/
protected $fillable = [
'name',
'email',
'password',
];
/**
* The attributes that should be hidden for serialization.
*
* @var array<int, string>
*/
protected $hidden = [
'password',
'remember_token',
];
/**
* Get the attributes that should be cast.
*
* @return array<string, string>
*/
protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
}
+24
View File
@@ -0,0 +1,24 @@
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
{
//
}
/**
* Bootstrap any application services.
*/
public function boot(): void
{
//
}
}