Inicio de sesion y probando con octane + frankenphp

This commit is contained in:
2025-01-12 22:55:11 -03:00
parent d4f65832f0
commit e5e040a53b
26 changed files with 2405 additions and 1687 deletions

5
.gitignore vendored
View File

@@ -21,3 +21,8 @@ yarn-error.log
/.nova
/.vscode
/.zed
.npm
**/caddy
frankenphp
frankenphp-worker.php

File diff suppressed because it is too large Load Diff

50
DockerfileFrankenPHP Normal file
View File

@@ -0,0 +1,50 @@
FROM dunglas/frankenphp:php8.4
ARG USER=app
ARG UID=1000
ARG GID=1000
ENV XDG_CONFIG_HOME=/home/${USER}/.config
RUN apt update && apt install -y nginx git curl zip unzip supervisor libpq-dev libzip-dev libicu-dev; \
curl -fsSL https://deb.nodesource.com/setup_23.x -o nodesource_setup.sh; \
bash nodesource_setup.sh; \
apt install nodejs; \
pecl install xdebug; \
install-php-extensions pdo_pgsql; \
install-php-extensions zip; \
install-php-extensions bcmath; \
install-php-extensions intl; \
install-php-extensions xdebug; \
install-php-extensions pcntl; \
apt clean; \
rm -rf /var/lib/{apt,dpkg,cache,log}/; \
apt clean autoclean; \
apt autoremove --yes
WORKDIR /app
COPY --from=composer:lts /usr/bin/composer /usr/local/bin/composer
COPY composer.json composer.lock ./
RUN composer install --no-dev --prefer-dist --no-autoloader --optimize-autoloader && rm -rf /root/.composer/cache/*
COPY ./ ./
RUN groupadd -g ${GID} ${USER}; \
useradd -m -u ${UID} -g ${GID} ${USER}; \
setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/frankenphp; \
mkdir -p /home/${USER}/.config; \
chown -R ${UID}:${GID} /data/caddy; \
chown -R ${UID}:${GID} /config/caddy; \
chown -R ${UID}:${GID} /app; \
chown -R ${UID}:${GID} /home/${USER};
USER ${USER}
RUN composer dump-autoload; \
npm install; \
npm run build; \
npm cache clean --force; \
rm -rf node_modules; \
rm -rf /tmp/* /var/tmp/*
EXPOSE 80
ENTRYPOINT ["php", "artisan", "octane:frankenphp", "--port=80"]

View File

@@ -11,4 +11,4 @@ down:
docker compose down
shell:
docker compose exec -u www-data laravel bash
docker compose exec laravel bash

View File

@@ -22909,6 +22909,161 @@ namespace Barryvdh\Debugbar\Facades {
}
}
namespace Laravel\Octane\Facades {
/**
*
*
* @see \Laravel\Octane\Octane
*/
class Octane {
/**
* Get a Swoole table instance.
*
* @static
*/
public static function table($table)
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->table($table);
}
/**
* Format an exception to a string that should be returned to the client.
*
* @static
*/
public static function formatExceptionForClient($e, $debug = false)
{
return \Laravel\Octane\Octane::formatExceptionForClient($e, $debug);
}
/**
* Write an error message to STDERR or to the SAPI logger if not in CLI mode.
*
* @static
*/
public static function writeError($message)
{
return \Laravel\Octane\Octane::writeError($message);
}
/**
* Concurrently resolve the given callbacks via background tasks, returning the results.
*
* Results will be keyed by their given keys - if a task did not finish, the tasks value will be "false".
*
* @return array
* @throws \Laravel\Octane\Exceptions\TaskException
* @throws \Laravel\Octane\Exceptions\TaskTimeoutException
* @static
*/
public static function concurrently($tasks, $waitMilliseconds = 3000)
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->concurrently($tasks, $waitMilliseconds);
}
/**
* Get the task dispatcher.
*
* @return \Laravel\Octane\Contracts\DispatchesTasks
* @static
*/
public static function tasks()
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->tasks();
}
/**
* Get the listeners that will prepare the Laravel application for a new request.
*
* @static
*/
public static function prepareApplicationForNextRequest()
{
return \Laravel\Octane\Octane::prepareApplicationForNextRequest();
}
/**
* Get the listeners that will prepare the Laravel application for a new operation.
*
* @static
*/
public static function prepareApplicationForNextOperation()
{
return \Laravel\Octane\Octane::prepareApplicationForNextOperation();
}
/**
* Get the container bindings / services that should be pre-resolved by default.
*
* @static
*/
public static function defaultServicesToWarm()
{
return \Laravel\Octane\Octane::defaultServicesToWarm();
}
/**
* Register a Octane route.
*
* @static
*/
public static function route($method, $uri, $callback)
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->route($method, $uri, $callback);
}
/**
* Determine if a route exists for the given method and URI.
*
* @static
*/
public static function hasRouteFor($method, $uri)
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->hasRouteFor($method, $uri);
}
/**
* Invoke the route for the given method and URI.
*
* @static
*/
public static function invokeRoute($request, $method, $uri)
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->invokeRoute($request, $method, $uri);
}
/**
* Get the registered Octane routes.
*
* @static
*/
public static function getRoutes()
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->getRoutes();
}
/**
* Register a callback to be called every N seconds.
*
* @return \Laravel\Octane\Swoole\InvokeTickCallable
* @static
*/
public static function tick($key, $callback, $seconds = 1, $immediate = true)
{
/** @var \Laravel\Octane\Octane $instance */
return $instance->tick($key, $callback, $seconds, $immediate);
}
}
}
namespace Livewire {
/**
*
@@ -22916,28 +23071,6 @@ namespace Livewire {
* @see \Livewire\LivewireManager
*/
class Livewire {
/**
* {@inheritDoc}
*
* @static
*/
public static function mount($name, $params = [], $key = null)
{
/** @var \Livewire\Volt\LivewireManager $instance */
return $instance->mount($name, $params, $key);
}
/**
* {@inheritDoc}
*
* @static
*/
public static function update($snapshot, $diff, $calls)
{
/** @var \Livewire\Volt\LivewireManager $instance */
return $instance->update($snapshot, $diff, $calls);
}
/**
*
*
@@ -22945,8 +23078,7 @@ namespace Livewire {
*/
public static function setProvider($provider)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->setProvider($provider);
}
@@ -22957,8 +23089,7 @@ namespace Livewire {
*/
public static function provide($callback)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->provide($callback);
}
@@ -22969,8 +23100,7 @@ namespace Livewire {
*/
public static function component($name, $class = null)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->component($name, $class);
}
@@ -22981,8 +23111,7 @@ namespace Livewire {
*/
public static function componentHook($hook)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->componentHook($hook);
}
@@ -22993,8 +23122,7 @@ namespace Livewire {
*/
public static function propertySynthesizer($synth)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->propertySynthesizer($synth);
}
@@ -23005,8 +23133,7 @@ namespace Livewire {
*/
public static function directive($name, $callback)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->directive($name, $callback);
}
@@ -23017,8 +23144,7 @@ namespace Livewire {
*/
public static function precompiler($callback)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->precompiler($callback);
}
@@ -23029,8 +23155,7 @@ namespace Livewire {
*/
public static function new($name, $id = null)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->new($name, $id);
}
@@ -23041,8 +23166,7 @@ namespace Livewire {
*/
public static function isDiscoverable($componentNameOrClass)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->isDiscoverable($componentNameOrClass);
}
@@ -23053,11 +23177,21 @@ namespace Livewire {
*/
public static function resolveMissingComponent($resolver)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->resolveMissingComponent($resolver);
}
/**
*
*
* @static
*/
public static function mount($name, $params = [], $key = null)
{
/** @var \Livewire\LivewireManager $instance */
return $instance->mount($name, $params, $key);
}
/**
*
*
@@ -23065,8 +23199,7 @@ namespace Livewire {
*/
public static function snapshot($component)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->snapshot($component);
}
@@ -23077,8 +23210,7 @@ namespace Livewire {
*/
public static function fromSnapshot($snapshot)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->fromSnapshot($snapshot);
}
@@ -23089,8 +23221,7 @@ namespace Livewire {
*/
public static function listen($eventName, $callback)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->listen($eventName, $callback);
}
@@ -23101,11 +23232,21 @@ namespace Livewire {
*/
public static function current()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->current();
}
/**
*
*
* @static
*/
public static function update($snapshot, $diff, $calls)
{
/** @var \Livewire\LivewireManager $instance */
return $instance->update($snapshot, $diff, $calls);
}
/**
*
*
@@ -23113,8 +23254,7 @@ namespace Livewire {
*/
public static function updateProperty($component, $path, $value)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->updateProperty($component, $path, $value);
}
@@ -23125,8 +23265,7 @@ namespace Livewire {
*/
public static function isLivewireRequest()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->isLivewireRequest();
}
@@ -23137,8 +23276,7 @@ namespace Livewire {
*/
public static function componentHasBeenRendered()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->componentHasBeenRendered();
}
@@ -23149,8 +23287,7 @@ namespace Livewire {
*/
public static function forceAssetInjection()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->forceAssetInjection();
}
@@ -23161,8 +23298,7 @@ namespace Livewire {
*/
public static function setUpdateRoute($callback)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->setUpdateRoute($callback);
}
@@ -23173,8 +23309,7 @@ namespace Livewire {
*/
public static function getUpdateUri()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->getUpdateUri();
}
@@ -23185,8 +23320,7 @@ namespace Livewire {
*/
public static function setScriptRoute($callback)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->setScriptRoute($callback);
}
@@ -23197,8 +23331,7 @@ namespace Livewire {
*/
public static function useScriptTagAttributes($attributes)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->useScriptTagAttributes($attributes);
}
@@ -23209,8 +23342,7 @@ namespace Livewire {
*/
public static function withUrlParams($params)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->withUrlParams($params);
}
@@ -23221,8 +23353,7 @@ namespace Livewire {
*/
public static function withQueryParams($params)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->withQueryParams($params);
}
@@ -23233,8 +23364,7 @@ namespace Livewire {
*/
public static function withCookie($name, $value)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->withCookie($name, $value);
}
@@ -23245,8 +23375,7 @@ namespace Livewire {
*/
public static function withCookies($cookies)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->withCookies($cookies);
}
@@ -23257,8 +23386,7 @@ namespace Livewire {
*/
public static function withHeaders($headers)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->withHeaders($headers);
}
@@ -23269,8 +23397,7 @@ namespace Livewire {
*/
public static function withoutLazyLoading()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->withoutLazyLoading();
}
@@ -23281,8 +23408,7 @@ namespace Livewire {
*/
public static function test($name, $params = [])
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->test($name, $params);
}
@@ -23293,8 +23419,7 @@ namespace Livewire {
*/
public static function visit($name)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->visit($name);
}
@@ -23305,8 +23430,7 @@ namespace Livewire {
*/
public static function actingAs($user, $driver = null)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->actingAs($user, $driver);
}
@@ -23317,8 +23441,7 @@ namespace Livewire {
*/
public static function isRunningServerless()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->isRunningServerless();
}
@@ -23329,8 +23452,7 @@ namespace Livewire {
*/
public static function addPersistentMiddleware($middleware)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->addPersistentMiddleware($middleware);
}
@@ -23341,8 +23463,7 @@ namespace Livewire {
*/
public static function setPersistentMiddleware($middleware)
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->setPersistentMiddleware($middleware);
}
@@ -23353,8 +23474,7 @@ namespace Livewire {
*/
public static function getPersistentMiddleware()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->getPersistentMiddleware();
}
@@ -23365,8 +23485,7 @@ namespace Livewire {
*/
public static function flushState()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->flushState();
}
@@ -23377,8 +23496,7 @@ namespace Livewire {
*/
public static function originalUrl()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->originalUrl();
}
@@ -23389,8 +23507,7 @@ namespace Livewire {
*/
public static function originalPath()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->originalPath();
}
@@ -23401,8 +23518,7 @@ namespace Livewire {
*/
public static function originalMethod()
{
//Method inherited from \Livewire\LivewireManager
/** @var \Livewire\Volt\LivewireManager $instance */
/** @var \Livewire\LivewireManager $instance */
return $instance->originalMethod();
}
@@ -23735,41 +23851,6 @@ namespace Illuminate\View {
}
}
namespace Illuminate\Testing {
/**
*
*
* @template TResponse of \Symfony\Component\HttpFoundation\Response
* @mixin \Illuminate\Http\Response
*/
class TestResponse {
/**
*
*
* @see \Livewire\Volt\VoltServiceProvider::registerTestingMacros()
* @param mixed $component
* @static
*/
public static function assertSeeVolt($component)
{
return \Illuminate\Testing\TestResponse::assertSeeVolt($component);
}
/**
*
*
* @see \Livewire\Volt\VoltServiceProvider::registerTestingMacros()
* @param mixed $component
* @static
*/
public static function assertDontSeeVolt($component)
{
return \Illuminate\Testing\TestResponse::assertDontSeeVolt($component);
}
}
}
namespace {
class App extends \Illuminate\Support\Facades\App {}
@@ -28131,6 +28212,7 @@ namespace {
class View extends \Illuminate\Support\Facades\View {}
class Vite extends \Illuminate\Support\Facades\Vite {}
class Debugbar extends \Barryvdh\Debugbar\Facades\Debugbar {}
class Octane extends \Laravel\Octane\Facades\Octane {}
class Livewire extends \Livewire\Livewire {}
class TallStackUi extends \TallStackUi\Facades\TallStackUi {}
}

View File

@@ -0,0 +1,20 @@
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
class LogoutController extends Controller
{
public function __invoke(Request $request)
{
Auth::logout();
$request->session()->invalidate();
$request->session()->regenerateToken();
return redirect('/');
}
}

View File

@@ -0,0 +1,44 @@
<?php
namespace App\Livewire\Auth;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Password;
use Livewire\Attributes\Layout;
use Livewire\Attributes\Validate;
use Livewire\Component;
use TallStackUi\Traits\Interactions;
#[Layout('components.layouts.login')]
class ForgotPassword extends Component
{
use Interactions;
#[Validate('required|email')]
public $email = '';
public function render(): View
{
return view('livewire.auth.forgot-password');
}
public function recover(): void
{
$this->validate();
$status = Password::sendResetLink(['email' => $this->email]);
if ($status === Password::RESET_LINK_SENT) {
$this->dialog()->success('Correo enviado', __($status))
->confirm(method: 'redirectToLogin')
->send();
} else {
$this->dialog()->error('Error', __($status))->send();
}
}
public function redirectToLogin(): void
{
$this->redirect(route('login'));
}
}

View File

@@ -0,0 +1,80 @@
<?php
namespace App\Livewire\Auth;
use Illuminate\Auth\Events\Lockout;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\RateLimiter;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Layout;
use Livewire\Attributes\Validate;
use Livewire\Component;
#[Layout('components.layouts.login')]
class Login extends Component
{
#[Validate('required|string|email')]
public $email = '';
#[Validate('required|string')]
public string $password = '';
#[Validate('boolean')]
public bool $remember = false;
public function render(): View
{
return view('livewire.auth.login');
}
public function login(): void
{
Session::invalidate();
$this->authenticate();
Session::regenerate();
$this->redirectIntended(route('home.index'));
}
public function authenticate(): void
{
$this->validate();
$this->ensureIsNotRateLimited();
if (! Auth::attempt($this->only('email', 'password'), $this->remember)) {
RateLimiter::hit($this->throttleKey());
throw ValidationException::withMessages([
'email' => __('auth.failed'),
]);
}
RateLimiter::clear($this->throttleKey());
}
protected function ensureIsNotRateLimited(): void
{
if (! RateLimiter::tooManyAttempts($this->throttleKey(), 5)) {
return;
}
event(new Lockout(request()));
$seconds = RateLimiter::availableIn($this->throttleKey());
throw ValidationException::withMessages([
'email' => trans('auth.throttle', [
'seconds' => $seconds,
'minutes' => ceil($seconds / 60),
]),
]);
}
protected function throttleKey(): string
{
return Str::transliterate(Str::lower($this->email).'|'.request()->ip());
}
}

View File

@@ -0,0 +1,67 @@
<?php
namespace App\Livewire\Auth;
use App\Models\User;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Contracts\View\View;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Password;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Str;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Layout;
use Livewire\Attributes\Url;
use Livewire\Attributes\Validate;
use Livewire\Component;
use TallStackUi\Traits\Interactions;
#[Layout('components.layouts.login')]
class ResetPassword extends Component
{
use Interactions;
#[Url]
#[Validate('required|email')]
public $email;
#[Validate('required')]
public $token;
#[Validate('required|min:8|confirmed')]
public $password;
#[Validate('required')]
public $password_confirmation;
public function render(): View
{
return view('livewire.auth.reset-password');
}
public function resetPassword(): void
{
$this->validate();
$status = Password::reset(
[
'email' => $this->email,
'token' => $this->token,
'password' => $this->password,
'password_confirmation' => $this->password_confirmation,
],
function (User $user, string $password) {
$user->forceFill(['password' => Hash::make($password)])->setRememberToken(Str::random(60));
$user->save();
event(new PasswordReset($user));
}
);
if ($status === Password::PASSWORD_RESET) {
Session::flash('toast', ['type' => 'success', 'message' => __($status)]);
$this->redirectRoute('login', navigate: true);
} else {
throw ValidationException::withMessages(['email' => __($status)]);
}
}
}

View File

@@ -2,19 +2,16 @@
namespace App\Livewire\Cajas;
use App\Models\Efectivo;
use App\Models\Turno;
use Carbon\Carbon;
use Exception;
use Illuminate\Contracts\View\View;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Number;
use Illuminate\Validation\ValidationException;
use Livewire\Attributes\Computed;
use Livewire\Component;
use Livewire\WithPagination;
use Log;
use TallStackUi\Traits\Interactions;
class Index extends Component
@@ -86,7 +83,7 @@ class Index extends Component
Session::flash('toast', ['type' => 'success', 'message' => 'Caja registrada correctamente']);
$this->redirectRoute('cajas.edit', $turno);
$this->redirectRoute('cajas.edit', $turno, navigate: true);
}
public function closeTurnoModal(): void
@@ -136,7 +133,7 @@ class Index extends Component
->orderBy('numero_caja', 'asc')
->orderBy('numero_turno', 'asc')
->when($this->searchFecha, function ($query) {
if (!$this->searchFecha) {
if (! $this->searchFecha) {
return;
}

View File

@@ -3,14 +3,17 @@ services:
image: zenithar:local
build:
context: .
dockerfile: DockerfileFrankenPHP
args:
UID: 1000
GID: 1000
ports:
- "80:80"
restart: on-failure
volumes:
- ./:/var/www/html
- ./:/app
env_file: .env
entrypoint: php artisan octane:frankenphp --watch --port=80 --workers=1 --max-requests=1
scheduler:
image: zenithar:local
@@ -27,12 +30,13 @@ services:
entrypoint: [ "php", "artisan", "queue:work" ]
vite:
image: zenithar:local
image: node:23
ports:
- "5173:5173"
volumes:
- .:/var/www/html
env_file: .env
- ./:/app
user: "1000:1000"
working_dir: /app
entrypoint: [ "npm", "run", "dev", "--", "--host" ]
mailpit:

View File

@@ -12,19 +12,16 @@
"php": "^8.2",
"laravel-lang/common": "^6.4",
"laravel/framework": "^11.31",
"laravel/octane": "^2.6",
"laravel/tinker": "^2.9",
"livewire/livewire": "^3.4",
"livewire/volt": "^1.0",
"tallstackui/tallstackui": "^1.37"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.14",
"barryvdh/laravel-ide-helper": "^3.4",
"fakerphp/faker": "^1.23",
"laravel/breeze": "^2.3",
"laravel/pail": "^1.1",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.1",
"pestphp/pest": "^3.7",

609
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "0da0dd867b794bfb7d8c7ea862565b39",
"content-hash": "665527920379b2afc38414405408a916",
"packages": [
{
"name": "archtechx/enums",
@@ -1577,6 +1577,94 @@
],
"time": "2023-12-03T19:50:20+00:00"
},
{
"name": "laminas/laminas-diactoros",
"version": "3.5.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-diactoros.git",
"reference": "143a16306602ce56b8b092a7914fef03c37f9ed2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-diactoros/zipball/143a16306602ce56b8b092a7914fef03c37f9ed2",
"reference": "143a16306602ce56b8b092a7914fef03c37f9ed2",
"shasum": ""
},
"require": {
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
"psr/http-factory": "^1.1",
"psr/http-message": "^1.1 || ^2.0"
},
"conflict": {
"amphp/amp": "<2.6.4"
},
"provide": {
"psr/http-factory-implementation": "^1.0",
"psr/http-message-implementation": "^1.1 || ^2.0"
},
"require-dev": {
"ext-curl": "*",
"ext-dom": "*",
"ext-gd": "*",
"ext-libxml": "*",
"http-interop/http-factory-tests": "^2.2.0",
"laminas/laminas-coding-standard": "~2.5.0",
"php-http/psr7-integration-tests": "^1.4.0",
"phpunit/phpunit": "^10.5.36",
"psalm/plugin-phpunit": "^0.19.0",
"vimeo/psalm": "^5.26.1"
},
"type": "library",
"extra": {
"laminas": {
"module": "Laminas\\Diactoros",
"config-provider": "Laminas\\Diactoros\\ConfigProvider"
}
},
"autoload": {
"files": [
"src/functions/create_uploaded_file.php",
"src/functions/marshal_headers_from_sapi.php",
"src/functions/marshal_method_from_sapi.php",
"src/functions/marshal_protocol_version_from_sapi.php",
"src/functions/normalize_server.php",
"src/functions/normalize_uploaded_files.php",
"src/functions/parse_cookie_header.php"
],
"psr-4": {
"Laminas\\Diactoros\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "PSR HTTP Message implementations",
"homepage": "https://laminas.dev",
"keywords": [
"http",
"laminas",
"psr",
"psr-17",
"psr-7"
],
"support": {
"chat": "https://laminas.dev/chat",
"docs": "https://docs.laminas.dev/laminas-diactoros/",
"forum": "https://discourse.laminas.dev",
"issues": "https://github.com/laminas/laminas-diactoros/issues",
"rss": "https://github.com/laminas/laminas-diactoros/releases.atom",
"source": "https://github.com/laminas/laminas-diactoros"
},
"funding": [
{
"url": "https://funding.communitybridge.org/projects/laminas-project",
"type": "community_bridge"
}
],
"time": "2024-10-14T11:59:49+00:00"
},
{
"name": "laravel-lang/actions",
"version": "1.8.10",
@@ -2862,6 +2950,96 @@
},
"time": "2025-01-02T20:10:21+00:00"
},
{
"name": "laravel/octane",
"version": "v2.6.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/octane.git",
"reference": "b8b11ef25600baa835d364e724f2e948dc1eb88b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/octane/zipball/b8b11ef25600baa835d364e724f2e948dc1eb88b",
"reference": "b8b11ef25600baa835d364e724f2e948dc1eb88b",
"shasum": ""
},
"require": {
"laminas/laminas-diactoros": "^3.0",
"laravel/framework": "^10.10.1|^11.0",
"laravel/prompts": "^0.1.24|^0.2.0|^0.3.0",
"laravel/serializable-closure": "^1.3|^2.0",
"nesbot/carbon": "^2.66.0|^3.0",
"php": "^8.1.0",
"symfony/console": "^6.0|^7.0",
"symfony/psr-http-message-bridge": "^2.2.0|^6.4|^7.0"
},
"conflict": {
"spiral/roadrunner": "<2023.1.0",
"spiral/roadrunner-cli": "<2.6.0",
"spiral/roadrunner-http": "<3.3.0"
},
"require-dev": {
"guzzlehttp/guzzle": "^7.6.1",
"inertiajs/inertia-laravel": "^0.6.9|^1.0",
"laravel/scout": "^10.2.1",
"laravel/socialite": "^5.6.1",
"livewire/livewire": "^2.12.3|^3.0",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^6.4.0|^7.5.2|^8.0",
"orchestra/testbench": "^8.21|^9.0",
"phpstan/phpstan": "^1.10.15",
"phpunit/phpunit": "^10.4",
"spiral/roadrunner-cli": "^2.6.0",
"spiral/roadrunner-http": "^3.3.0"
},
"bin": [
"bin/roadrunner-worker",
"bin/swoole-server"
],
"type": "library",
"extra": {
"laravel": {
"aliases": {
"Octane": "Laravel\\Octane\\Facades\\Octane"
},
"providers": [
"Laravel\\Octane\\OctaneServiceProvider"
]
},
"branch-alias": {
"dev-master": "2.x-dev"
}
},
"autoload": {
"psr-4": {
"Laravel\\Octane\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Supercharge your Laravel application's performance.",
"keywords": [
"frankenphp",
"laravel",
"octane",
"roadrunner",
"swoole"
],
"support": {
"issues": "https://github.com/laravel/octane/issues",
"source": "https://github.com/laravel/octane"
},
"time": "2024-11-25T21:47:18+00:00"
},
{
"name": "laravel/prompts",
"version": "v0.3.2",
@@ -3675,78 +3853,6 @@
],
"time": "2024-12-23T15:05:02+00:00"
},
{
"name": "livewire/volt",
"version": "v1.6.6",
"source": {
"type": "git",
"url": "https://github.com/livewire/volt.git",
"reference": "9efa7bd50a71ad166ac44ed9322d2c004e0ece5f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/livewire/volt/zipball/9efa7bd50a71ad166ac44ed9322d2c004e0ece5f",
"reference": "9efa7bd50a71ad166ac44ed9322d2c004e0ece5f",
"shasum": ""
},
"require": {
"laravel/framework": "^10.38.2|^11.0",
"livewire/livewire": "^3.0",
"php": "^8.1"
},
"require-dev": {
"laravel/folio": "^1.1",
"mockery/mockery": "^1.6",
"orchestra/testbench": "^8.15.0|^9.0",
"pestphp/pest": "^2.9.5",
"phpstan/phpstan": "^1.10"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Livewire\\Volt\\VoltServiceProvider"
]
},
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"files": [
"functions.php"
],
"psr-4": {
"Livewire\\Volt\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
},
{
"name": "Nuno Maduro",
"email": "nuno@laravel.com"
}
],
"description": "An elegantly crafted functional API for Laravel Livewire.",
"homepage": "https://github.com/livewire/volt",
"keywords": [
"laravel",
"livewire",
"volt"
],
"support": {
"issues": "https://github.com/livewire/volt/issues",
"source": "https://github.com/livewire/volt"
},
"time": "2024-11-12T14:51:01+00:00"
},
{
"name": "monolog/monolog",
"version": "3.8.1",
@@ -6763,6 +6869,89 @@
],
"time": "2024-11-06T14:24:19+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
"version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/psr-http-message-bridge.git",
"reference": "03f2f72319e7acaf2a9f6fcbe30ef17eec51594f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/03f2f72319e7acaf2a9f6fcbe30ef17eec51594f",
"reference": "03f2f72319e7acaf2a9f6fcbe30ef17eec51594f",
"shasum": ""
},
"require": {
"php": ">=8.2",
"psr/http-message": "^1.0|^2.0",
"symfony/http-foundation": "^6.4|^7.0"
},
"conflict": {
"php-http/discovery": "<1.15",
"symfony/http-kernel": "<6.4"
},
"require-dev": {
"nyholm/psr7": "^1.1",
"php-http/discovery": "^1.15",
"psr/log": "^1.1.4|^2|^3",
"symfony/browser-kit": "^6.4|^7.0",
"symfony/config": "^6.4|^7.0",
"symfony/event-dispatcher": "^6.4|^7.0",
"symfony/framework-bundle": "^6.4|^7.0",
"symfony/http-kernel": "^6.4|^7.0"
},
"type": "symfony-bridge",
"autoload": {
"psr-4": {
"Symfony\\Bridge\\PsrHttpMessage\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "PSR HTTP message bridge",
"homepage": "https://symfony.com",
"keywords": [
"http",
"http-message",
"psr-17",
"psr-7"
],
"support": {
"source": "https://github.com/symfony/psr-http-message-bridge/tree/v7.2.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-09-26T08:57:56+00:00"
},
{
"name": "symfony/routing",
"version": "v7.2.0",
@@ -8361,145 +8550,6 @@
},
"time": "2024-11-18T16:19:46+00:00"
},
{
"name": "laravel/breeze",
"version": "v2.3.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/breeze.git",
"reference": "d59702967b9ae21879df905d691a50132966c4ff"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/breeze/zipball/d59702967b9ae21879df905d691a50132966c4ff",
"reference": "d59702967b9ae21879df905d691a50132966c4ff",
"shasum": ""
},
"require": {
"illuminate/console": "^11.0",
"illuminate/filesystem": "^11.0",
"illuminate/support": "^11.0",
"illuminate/validation": "^11.0",
"php": "^8.2.0",
"symfony/console": "^7.0"
},
"require-dev": {
"laravel/framework": "^11.0",
"orchestra/testbench-core": "^9.0",
"phpstan/phpstan": "^2.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravel\\Breeze\\BreezeServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Breeze\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Minimal Laravel authentication scaffolding with Blade and Tailwind.",
"keywords": [
"auth",
"laravel"
],
"support": {
"issues": "https://github.com/laravel/breeze/issues",
"source": "https://github.com/laravel/breeze"
},
"time": "2024-12-14T21:21:42+00:00"
},
{
"name": "laravel/pail",
"version": "v1.2.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/pail.git",
"reference": "353ac12134b98e2e7c3333d916bd3e523931e583"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pail/zipball/353ac12134b98e2e7c3333d916bd3e523931e583",
"reference": "353ac12134b98e2e7c3333d916bd3e523931e583",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"illuminate/console": "^10.24|^11.0",
"illuminate/contracts": "^10.24|^11.0",
"illuminate/log": "^10.24|^11.0",
"illuminate/process": "^10.24|^11.0",
"illuminate/support": "^10.24|^11.0",
"nunomaduro/termwind": "^1.15|^2.0",
"php": "^8.2",
"symfony/console": "^6.0|^7.0"
},
"require-dev": {
"laravel/framework": "^10.24|^11.0",
"laravel/pint": "^1.13",
"orchestra/testbench-core": "^8.12|^9.0",
"pestphp/pest": "^2.20",
"pestphp/pest-plugin-type-coverage": "^2.3",
"phpstan/phpstan": "^1.10",
"symfony/var-dumper": "^6.3|^7.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravel\\Pail\\PailServiceProvider"
]
},
"branch-alias": {
"dev-main": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"Laravel\\Pail\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
},
{
"name": "Nuno Maduro",
"email": "enunomaduro@gmail.com"
}
],
"description": "Easily delve into your Laravel application's log files directly from the command line.",
"homepage": "https://github.com/laravel/pail",
"keywords": [
"laravel",
"logs",
"php",
"tail"
],
"support": {
"issues": "https://github.com/laravel/pail/issues",
"source": "https://github.com/laravel/pail"
},
"time": "2024-10-23T12:56:23+00:00"
},
{
"name": "laravel/pint",
"version": "v1.19.0",
@@ -8566,69 +8616,6 @@
},
"time": "2024-12-30T16:20:10+00:00"
},
{
"name": "laravel/sail",
"version": "v1.39.1",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "1a3c7291bc88de983b66688919a4d298d68ddec7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/1a3c7291bc88de983b66688919a4d298d68ddec7",
"reference": "1a3c7291bc88de983b66688919a4d298d68ddec7",
"shasum": ""
},
"require": {
"illuminate/console": "^9.52.16|^10.0|^11.0",
"illuminate/contracts": "^9.52.16|^10.0|^11.0",
"illuminate/support": "^9.52.16|^10.0|^11.0",
"php": "^8.0",
"symfony/console": "^6.0|^7.0",
"symfony/yaml": "^6.0|^7.0"
},
"require-dev": {
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpstan/phpstan": "^1.10"
},
"bin": [
"bin/sail"
],
"type": "library",
"extra": {
"laravel": {
"providers": [
"Laravel\\Sail\\SailServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Sail\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Docker files for running a basic Laravel application.",
"keywords": [
"docker",
"laravel"
],
"support": {
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2024-11-27T15:42:28+00:00"
},
{
"name": "maximebf/debugbar",
"version": "v1.23.5",
@@ -11077,78 +11064,6 @@
],
"time": "2024-10-20T05:08:20+00:00"
},
{
"name": "symfony/yaml",
"version": "v7.2.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "099581e99f557e9f16b43c5916c26380b54abb22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/099581e99f557e9f16b43c5916c26380b54abb22",
"reference": "099581e99f557e9f16b43c5916c26380b54abb22",
"shasum": ""
},
"require": {
"php": ">=8.2",
"symfony/deprecation-contracts": "^2.5|^3.0",
"symfony/polyfill-ctype": "^1.8"
},
"conflict": {
"symfony/console": "<6.4"
},
"require-dev": {
"symfony/console": "^6.4|^7.0"
},
"bin": [
"Resources/bin/yaml-lint"
],
"type": "library",
"autoload": {
"psr-4": {
"Symfony\\Component\\Yaml\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v7.2.0"
},
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2024-10-23T06:56:12+00:00"
},
{
"name": "ta-tikoma/phpunit-architecture-test",
"version": "0.8.4",

225
config/octane.php Normal file
View File

@@ -0,0 +1,225 @@
<?php
use Barryvdh\Debugbar\LaravelDebugbar;
use Laravel\Octane\Contracts\OperationTerminated;
use Laravel\Octane\Events\RequestHandled;
use Laravel\Octane\Events\RequestReceived;
use Laravel\Octane\Events\RequestTerminated;
use Laravel\Octane\Events\TaskReceived;
use Laravel\Octane\Events\TaskTerminated;
use Laravel\Octane\Events\TickReceived;
use Laravel\Octane\Events\TickTerminated;
use Laravel\Octane\Events\WorkerErrorOccurred;
use Laravel\Octane\Events\WorkerStarting;
use Laravel\Octane\Events\WorkerStopping;
use Laravel\Octane\Listeners\CloseMonologHandlers;
use Laravel\Octane\Listeners\CollectGarbage;
use Laravel\Octane\Listeners\DisconnectFromDatabases;
use Laravel\Octane\Listeners\EnsureUploadedFilesAreValid;
use Laravel\Octane\Listeners\EnsureUploadedFilesCanBeMoved;
use Laravel\Octane\Listeners\FlushOnce;
use Laravel\Octane\Listeners\FlushTemporaryContainerInstances;
use Laravel\Octane\Listeners\FlushUploadedFiles;
use Laravel\Octane\Listeners\ReportException;
use Laravel\Octane\Listeners\StopWorkerIfNecessary;
use Laravel\Octane\Octane;
return [
/*
|--------------------------------------------------------------------------
| Octane Server
|--------------------------------------------------------------------------
|
| This value determines the default "server" that will be used by Octane
| when starting, restarting, or stopping your server via the CLI. You
| are free to change this to the supported server of your choosing.
|
| Supported: "roadrunner", "swoole", "frankenphp"
|
*/
'server' => env('OCTANE_SERVER', 'roadrunner'),
/*
|--------------------------------------------------------------------------
| Force HTTPS
|--------------------------------------------------------------------------
|
| When this configuration value is set to "true", Octane will inform the
| framework that all absolute links must be generated using the HTTPS
| protocol. Otherwise your links may be generated using plain HTTP.
|
*/
'https' => env('OCTANE_HTTPS', false),
/*
|--------------------------------------------------------------------------
| Octane Listeners
|--------------------------------------------------------------------------
|
| All of the event listeners for Octane's events are defined below. These
| listeners are responsible for resetting your application's state for
| the next request. You may even add your own listeners to the list.
|
*/
'listeners' => [
WorkerStarting::class => [
EnsureUploadedFilesAreValid::class,
EnsureUploadedFilesCanBeMoved::class,
],
RequestReceived::class => [
...Octane::prepareApplicationForNextOperation(),
...Octane::prepareApplicationForNextRequest(),
//
],
RequestHandled::class => [
//
],
RequestTerminated::class => [
// FlushUploadedFiles::class,
],
TaskReceived::class => [
...Octane::prepareApplicationForNextOperation(),
//
],
TaskTerminated::class => [
//
],
TickReceived::class => [
...Octane::prepareApplicationForNextOperation(),
//
],
TickTerminated::class => [
//
],
OperationTerminated::class => [
FlushOnce::class,
FlushTemporaryContainerInstances::class,
// DisconnectFromDatabases::class,
// CollectGarbage::class,
],
WorkerErrorOccurred::class => [
ReportException::class,
StopWorkerIfNecessary::class,
],
WorkerStopping::class => [
CloseMonologHandlers::class,
],
],
/*
|--------------------------------------------------------------------------
| Warm / Flush Bindings
|--------------------------------------------------------------------------
|
| The bindings listed below will either be pre-warmed when a worker boots
| or they will be flushed before every new request. Flushing a binding
| will force the container to resolve that binding again when asked.
|
*/
'warm' => [
...Octane::defaultServicesToWarm(),
],
'flush' => [
LaravelDebugbar::class,
],
/*
|--------------------------------------------------------------------------
| Octane Swoole Tables
|--------------------------------------------------------------------------
|
| While using Swoole, you may define additional tables as required by the
| application. These tables can be used to store data that needs to be
| quickly accessed by other workers on the particular Swoole server.
|
*/
'tables' => [
'example:1000' => [
'name' => 'string:1000',
'votes' => 'int',
],
],
/*
|--------------------------------------------------------------------------
| Octane Swoole Cache Table
|--------------------------------------------------------------------------
|
| While using Swoole, you may leverage the Octane cache, which is powered
| by a Swoole table. You may set the maximum number of rows as well as
| the number of bytes per row using the configuration options below.
|
*/
'cache' => [
'rows' => 1000,
'bytes' => 10000,
],
/*
|--------------------------------------------------------------------------
| File Watching
|--------------------------------------------------------------------------
|
| The following list of files and directories will be watched when using
| the --watch option offered by Octane. If any of the directories and
| files are changed, Octane will automatically reload your workers.
|
*/
'watch' => [
'app',
'bootstrap',
'config/**/*.php',
'database/**/*.php',
'public/**/*.php',
'resources/**/*.php',
'routes',
'composer.lock',
'.env',
],
/*
|--------------------------------------------------------------------------
| Garbage Collection Threshold
|--------------------------------------------------------------------------
|
| When executing long-lived PHP scripts such as Octane, memory can build
| up before being cleared by PHP. You can force Octane to run garbage
| collection if your application consumes this amount of megabytes.
|
*/
'garbage' => 50,
/*
|--------------------------------------------------------------------------
| Maximum Execution Time
|--------------------------------------------------------------------------
|
| The following setting configures the maximum execution time for requests
| being handled by Octane. You may set this value to 0 to indicate that
| there isn't a specific time limit on Octane request execution time.
|
*/
'max_execution_time' => 30,
];

101
package-lock.json generated
View File

@@ -1,5 +1,5 @@
{
"name": "html",
"name": "app",
"lockfileVersion": 3,
"requires": true,
"packages": {
@@ -8,6 +8,7 @@
"@tailwindcss/forms": "^0.5.9",
"autoprefixer": "^10.4.2",
"axios": "^1.7.4",
"chokidar": "^4.0.3",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^1.0",
"postcss": "^8.4.31",
@@ -1111,41 +1112,19 @@
}
},
"node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz",
"integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==",
"dev": true,
"license": "MIT",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
"readdirp": "^4.0.1"
},
"engines": {
"node": ">= 8.10.0"
"node": ">= 14.16.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/chokidar/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/cliui": {
@@ -2221,16 +2200,17 @@
}
},
"node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.1.tgz",
"integrity": "sha512-h80JrZu/MHUZCyHu5ciuoI0+WxsCxzxJTILn6Fs8rxSnFPh+UVHYfeIxK1nVGugMqkfC4vJcBOYbkfkwYK0+gw==",
"dev": true,
"license": "MIT",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
"node": ">= 14.18.0"
},
"funding": {
"type": "individual",
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/require-directory": {
@@ -2601,6 +2581,57 @@
"node": ">=14.0.0"
}
},
"node_modules/tailwindcss/node_modules/chokidar": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz",
"integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==",
"dev": true,
"license": "MIT",
"dependencies": {
"anymatch": "~3.1.2",
"braces": "~3.0.2",
"glob-parent": "~5.1.2",
"is-binary-path": "~2.1.0",
"is-glob": "~4.0.1",
"normalize-path": "~3.0.0",
"readdirp": "~3.6.0"
},
"engines": {
"node": ">= 8.10.0"
},
"funding": {
"url": "https://paulmillr.com/funding/"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/tailwindcss/node_modules/chokidar/node_modules/glob-parent": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
"dev": true,
"license": "ISC",
"dependencies": {
"is-glob": "^4.0.1"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/tailwindcss/node_modules/readdirp": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz",
"integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==",
"dev": true,
"license": "MIT",
"dependencies": {
"picomatch": "^2.2.1"
},
"engines": {
"node": ">=8.10.0"
}
},
"node_modules/thenify": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz",

View File

@@ -9,6 +9,7 @@
"@tailwindcss/forms": "^0.5.9",
"autoprefixer": "^10.4.2",
"axios": "^1.7.4",
"chokidar": "^4.0.3",
"concurrently": "^9.0.1",
"laravel-vite-plugin": "^1.0",
"postcss": "^8.4.31",

View File

@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zenithar</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Domine:wght@400..700&family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Karla:ital,wght@0,200..800;1,200..800&family=Nunito:ital,wght@0,200..1000;1,200..1000&family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
rel="stylesheet">
<tallstackui:script/>
@livewireStyles
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body class="flex flex-col min-h-screen">
<x-dialog/>
<x-toast/>
<x-flash/>
<div class="flex-1 bg-secondary-50 overflow-x-auto">
{{ $slot }}
</div>
@livewireScripts
</body>
</html>

View File

@@ -1,29 +1,39 @@
<div class="shadow z-10">
<div class="border-b">
<div class="container mx-auto flex flex-col items-center justify-between gap-2 px-4 py-4 sm:py-0 sm:h-14 sm:flex-row">
<div
class="container mx-auto flex flex-col items-center justify-between gap-2 px-4 py-4 sm:py-0 sm:h-14 sm:flex-row">
<span class="text-4xl sm:text-2xl font-semibold text-primary-700">Zenithar</span>
<x-dropdown>
<x-slot:action>
<button class="flex items-center gap-2 rounded p-1 text-start hover:bg-secondary-50 active:bg-secondary-100"
x-on:click="show = !show">
<img class="h-8 rounded" src="https://api.dicebear.com/9.x/thumbs/svg" alt="avatar" />
<button
class="flex items-center gap-2 rounded p-1 text-start hover:bg-secondary-50 active:bg-secondary-100"
x-on:click="show = !show">
<img class="h-8 rounded" src="https://api.dicebear.com/9.x/thumbs/svg" alt="avatar"/>
<div>
<p class="text-sm">Daniel Cortés</p>
<p class="text-sm">{{auth()->user()->name}}</p>
<p class="text-xs text-secondary">Administrador</p>
</div>
</button>
</x-slot:action>
<x-dropdown.items text="Cerrar Sesión" separator />
<form action="{{route('logout')}}" method="POST">
@csrf
<button type="submit" class="w-full">
<x-dropdown.items text="Cerrar Sesión" separator/>
</button>
</form>
</x-dropdown>
</div>
</div>
<div class="border-b">
<nav class="container mx-auto flex flex-col sm:h-14 sm:flex-row sm:px-4">
<x-navlink icon="home" :route="route('home.index')" :active="Route::is('home.*')" title="Inicio" />
<x-navlink icon="cash" :route="route('cajas.index')" :active="Route::is('cajas.*')" title="Cajas" />
<x-navlink icon="report" :route="route('reportes.index')" :active="Route::is('reportes.*')" title="Reportes" />
<x-navlink icon="settings" :route="route('configuracion.index')" :active="Route::is('configuracion.*')" title="Configuración" />
<x-navlink icon="home" :route="route('home.index')" :active="Route::is('home.*')" title="Inicio"/>
<x-navlink icon="cash" :route="route('cajas.index')" :active="Route::is('cajas.*')" title="Cajas"/>
<x-navlink icon="report" :route="route('reportes.index')" :active="Route::is('reportes.*')"
title="Reportes"/>
<x-navlink icon="settings" :route="route('configuracion.index')" :active="Route::is('configuracion.*')"
title="Configuración"/>
</nav>
</div>
</div>

View File

@@ -0,0 +1,19 @@
<div class="min-h-screen flex flex-col items-center sm:justify-center">
<div class="w-full sm:max-w-md px-6 py-4">
<h1 class="text-center text-5xl font-semibold text-primary-700 mb-4">Zenithar</h1>
<p class="text-lg text-center font-medium mb-4">Recuperar Contraseña</p>
<x-card>
<form wire:submit="recover">
<div>
<x-input wire:model="email" :label="__('Email')" type="email" required autocomplete="username"/>
</div>
<div class="flex flex-col items-end justify-center mt-4 gap-2">
<x-button class="ms-3" type="submit">
Enviar correo de recuperación
</x-button>
</div>
</form>
</x-card>
</div>
</div>

View File

@@ -0,0 +1,30 @@
<div class="min-h-screen flex flex-col items-center sm:justify-center">
<div class="w-full sm:max-w-md px-6 py-4">
<h1 class="text-center text-5xl font-semibold text-primary-700 mb-4">Zenithar</h1>
<x-card>
<form wire:submit="login">
<div>
<x-input wire:model="email" :label="__('Email')" type="email" required
autocomplete="username"/>
</div>
<div class="mt-4">
<x-password wire:model="password" :label="__('Password')" type="password" required
autocomplete="current-password"/>
</div>
<div class="mt-4">
<x-toggle wire:model="remember" :label="__('Remember me')"/>
</div>
<div class="flex flex-col items-end justify-center mt-4 gap-2">
<x-button class="ms-3" type="submit">
{{ __('Log in') }}
</x-button>
<x-link href="{{route('forgot-password')}}" wire:navigate class="text-sm">Olvide mi contraseña
</x-link>
</div>
</form>
</x-card>
</div>
</div>

View File

@@ -0,0 +1,20 @@
<div class="min-h-screen flex flex-col items-center sm:justify-center">
<div class="w-full sm:max-w-md px-6 py-4">
<h1 class="text-center text-5xl font-semibold text-primary-700 mb-4">Zenithar</h1>
<p class="text-lg text-center font-medium mb-4">Ingrese su nueva contraseña</p>
<x-card>
<form wire:submit="resetPassword">
<div class="space-y-4">
<x-password wire:model="password" :label="__('Password')" required/>
<x-password wire:model="password_confirmation" :label="__('Confirm Password')" required/>
</div>
<div class="flex flex-col items-end justify-center mt-4 gap-2">
<x-button class="ms-3" type="submit">
Cambiar contraseña
</x-button>
</div>
</form>
</x-card>
</div>
</div>

View File

@@ -5,7 +5,7 @@
{{$this->turno ? "Editar caja" : "Registrar Caja"}}
</x-title>
<x-button icon="arrow-left" color="secondary" href="{{route('cajas.index')}}">
<x-button icon="arrow-left" color="secondary" wire:navigate href="{{route('cajas.index')}}">
Volver
</x-button>
</div>
@@ -16,7 +16,7 @@
<p class="font-bold text-secondary">{{$turno->fecha->format('d-m-Y')}}</p>
</div>
<div>
<x-label>Fecha</x-label>
<x-label>Caja</x-label>
<p class="font-bold text-secondary">{{$turno->numero_caja}}</p>
</div>
<div>

View File

@@ -24,7 +24,7 @@
</span>
@endinteract
@interact('column_action', $row)
<x-button.circle icon="edit" :href="route('cajas.edit', $row->id)" :key="uniqid()"/>
<x-button.circle icon="edit" :href="route('cajas.edit', $row->id)" wire:navigate :key="uniqid()"/>
<x-button.circle icon="trash" color="red" wire:click="confirmDelete('{{$row->id}}')" :key="uniqid()"/>
@endinteract
</x-table>

View File

@@ -1 +0,0 @@
<?php

View File

@@ -1,15 +1,24 @@
<?php
use App\Http\Controllers\Auth\LogoutController;
use Illuminate\Support\Facades\Route;
Route::get('/', App\Livewire\Home\Index::class)->name('home.index');
Route::get('/reportes', App\Livewire\Reportes\Index::class)->name('reportes.index');
Route::get('/configuracion', App\Livewire\Configuracion\Index::class)->name('configuracion.index');
Route::name('cajas.')->prefix('cajas')->group(function () {
Route::get('/', App\Livewire\Cajas\Index::class)->name('index');
Route::get('/{turno}/edit', App\Livewire\Cajas\Edit::class)->name('edit');
Route::middleware('guest')->group(function () {
Route::get('/login', App\Livewire\Auth\Login::class)->name('login');
Route::get('/forgot-password', App\Livewire\Auth\ForgotPassword::class)->name('forgot-password');
Route::get('recover-password/{token}', App\Livewire\Auth\ResetPassword::class)->name('password.reset');
});
require __DIR__.'/auth.php';
Route::middleware('auth')->group(function () {
Route::post('/logout', LogoutController::class)->name('logout');
Route::get('/', App\Livewire\Home\Index::class)->name('home.index');
Route::get('/reportes', App\Livewire\Reportes\Index::class)->name('reportes.index');
Route::get('/configuracion', App\Livewire\Configuracion\Index::class)->name('configuracion.index');
Route::name('cajas.')->prefix('cajas')->group(function () {
Route::get('/', App\Livewire\Cajas\Index::class)->name('index');
Route::get('/{turno}/edit', App\Livewire\Cajas\Edit::class)->name('edit');
});
});

View File

@@ -2,7 +2,6 @@ import defaultTheme from 'tailwindcss/defaultTheme';
import colors from 'tailwindcss/colors';
import forms from '@tailwindcss/forms';
console.log(colors)
/** @type {import('tailwindcss').Config} */
export default {
presets: [