Compare commits
2 Commits
4796d87d81
...
ec4f167dcf
| Author | SHA1 | Date | |
|---|---|---|---|
| ec4f167dcf | |||
| 9a82045204 |
39
app/Http/Controllers/Auth/ConfirmPasswordController.php
Normal file
39
app/Http/Controllers/Auth/ConfirmPasswordController.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
||||
22
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
22
app/Http/Controllers/Auth/ForgotPasswordController.php
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
||||
|
||||
class ForgotPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset emails and
|
||||
| includes a trait which assists in sending these notifications from
|
||||
| your application to your users. Feel free to explore this trait.
|
||||
|
|
||||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
}
|
||||
40
app/Http/Controllers/Auth/LoginController.php
Normal file
40
app/Http/Controllers/Auth/LoginController.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Login Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles authenticating users for the application and
|
||||
| redirecting them to your home screen. The controller uses a trait
|
||||
| to conveniently provide its functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
use AuthenticatesUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after login.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest')->except('logout');
|
||||
$this->middleware('auth')->only('logout');
|
||||
}
|
||||
}
|
||||
70
app/Http/Controllers/Auth/RegisterController.php
Normal file
70
app/Http/Controllers/Auth/RegisterController.php
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller handles the registration of new users as well as their
|
||||
| validation and creation. By default this controller uses a trait to
|
||||
| provide this functionality without requiring any additional code.
|
||||
|
|
||||
*/
|
||||
|
||||
use RegistersUsers;
|
||||
|
||||
/**
|
||||
* Where to redirect users after registration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a validator for an incoming registration request.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Validation\Validator
|
||||
*/
|
||||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new user instance after a valid registration.
|
||||
*
|
||||
* @return User
|
||||
*/
|
||||
protected function create(array $data)
|
||||
{
|
||||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
29
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
29
app/Http/Controllers/Auth/ResetPasswordController.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Reset Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password reset requests
|
||||
| and uses a simple trait to include this behavior. You're free to
|
||||
| explore this trait and override any methods you wish to tweak.
|
||||
|
|
||||
*/
|
||||
|
||||
use ResetsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users after resetting their password.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
}
|
||||
41
app/Http/Controllers/Auth/VerificationController.php
Normal file
41
app/Http/Controllers/Auth/VerificationController.php
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/home';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
||||
28
app/Http/Controllers/HomeController.php
Normal file
28
app/Http/Controllers/HomeController.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the application dashboard.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Support\Renderable
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('home');
|
||||
}
|
||||
}
|
||||
|
|
@ -5,16 +5,15 @@ namespace App\Http\Controllers;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use App\Models\Persona;
|
||||
use App\Http\Requests\UpdatedPersonaRequest;
|
||||
|
||||
class PersonaController extends Controller
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$persona = Persona::withTrashed()-> get();
|
||||
public function index(Request $request){
|
||||
|
||||
return view('personas.index',["personas"=>$persona]);
|
||||
$persona = Persona::withTrashed()->get();
|
||||
|
||||
// $categorias = Categorias::findOrFail(13);
|
||||
// $categorias = Categorias::findOrFail(13);
|
||||
//$cat = Categorias::where('id_categoria', 1)->first();
|
||||
//$categorias = Categorias::where('descripcion', 'Cursos, capacitaciones y formación')->get();
|
||||
//$categorias = Categorias::where('descripcion', 'like', '%Prod%')->get();
|
||||
|
|
@ -24,6 +23,9 @@ class PersonaController extends Controller
|
|||
//$categorias = Categorias::first();
|
||||
//$categorias = Categorias::last();
|
||||
/*Categorias::count();*/
|
||||
|
||||
|
||||
return view('personas.index', ["persona"=>$persona]);
|
||||
}
|
||||
public function show($id){
|
||||
$persona = Persona::findOrfail($id);
|
||||
|
|
@ -33,6 +35,7 @@ class PersonaController extends Controller
|
|||
public function destroy(Request $request, $id){
|
||||
$persona = Persona::findOrfail($id);
|
||||
$persona->delete();
|
||||
$request->session()->flash('mensaje-success', 'La persona fue eliminada.');
|
||||
return redirect('/personas');
|
||||
}
|
||||
|
||||
|
|
@ -43,13 +46,35 @@ class PersonaController extends Controller
|
|||
|
||||
public function store(Request $request){
|
||||
|
||||
$request->validate([
|
||||
'apellido' => 'required|regex:/^[a-zA-ZáéíóúñÁÉÍÓÚ]+( [a-zA-ZáéíóúñÁÉÍÓÚ]+)*$/|max:20|unique:persona,apellido',
|
||||
'nombre' => 'required|regex:/^[a-zA-ZáéíóúñÁÉÍÓÚ]+( [a-zA-ZáéíóúñÁÉÍÓÚ]+)*$/|max:20|unique:persona,nombre',
|
||||
'dni' => 'required|numeric|digits_between:7,8',
|
||||
],
|
||||
[
|
||||
'apellido.required' => 'el campo apellido es requerido',
|
||||
'apellido.regex' => 'el campo apellido solo debe contener letras',
|
||||
'apellido.max' => 'el campo apellido debe contener un maximo de 20 caracteres',
|
||||
'apellido.unique' => 'ya existe este apellido',
|
||||
'nombre.required' => 'el campo nombre es requerido',
|
||||
'nombre.regex' => 'el campo nombre solo debe contener letras',
|
||||
'nombre.max' => 'el campo nombre debe contener un maximo de 20 caracteres',
|
||||
'nombre.unique' => 'ya existe este nombre',
|
||||
'dni' => 'el campo dni es requerido',
|
||||
'dni' => 'el campo dni debe contener solo numeros',
|
||||
'dni' => 'el campo dni debe contener un maximo de 8 caracteres',
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$persona = new Persona();
|
||||
$persona->fill([
|
||||
'apellido' => $request->input('apellido'),
|
||||
'apellido'=> $request->input('apellido'),
|
||||
'nombre' => $request->input('nombre'),
|
||||
'dni' => $request->input('dni'),
|
||||
]);
|
||||
$persona->save();
|
||||
$request->session()->flash('mensaje-success', 'La persona fue agregada.');
|
||||
return redirect('/personas');
|
||||
}
|
||||
|
||||
|
|
@ -62,48 +87,21 @@ class PersonaController extends Controller
|
|||
public function update(Request $request, $id){
|
||||
$persona = Persona::findOrfail($id);
|
||||
$persona->fill([
|
||||
'apellido' => $request->input('apellido'),
|
||||
'apellido'=> $request->input('apellido'),
|
||||
'nombre' => $request->input('nombre'),
|
||||
'dni' => $request->input('dni'),
|
||||
]);
|
||||
$persona->update();
|
||||
$request->session()->flash('mensaje-success', 'La persona fue modificada.');
|
||||
return redirect('/personas');
|
||||
}
|
||||
|
||||
public function restaurar(Request $request, $id){
|
||||
$persona = Persona::withTrashed()->findOrfail($id);
|
||||
$persona->restore();
|
||||
$request->session()->flash('mensaje-success', 'La persona fue restaurada.');
|
||||
return redirect('/personas');
|
||||
}
|
||||
/*
|
||||
|
||||
|
||||
|
||||
public function show($id){
|
||||
$categorias = Categorias::findOrfail($id);
|
||||
|
||||
return view('categorias.show', ["cat"=>$categorias]);
|
||||
}
|
||||
|
||||
|
||||
public function edit($id){
|
||||
$categorias = Categorias::findOrfail($id);
|
||||
return view('categorias.edit', ["cat"=>$categorias]);
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id){
|
||||
$categorias = Categorias::findOrfail($id);
|
||||
$categorias->fill([
|
||||
'nombre' => $request->input('nombre'),
|
||||
'descripcion' => $request->input('descripcion'),
|
||||
]);
|
||||
$categorias->update();
|
||||
return redirect('/categorias');
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
45
app/Http/Requests/UpdatedPersonaRequest.php
Normal file
45
app/Http/Requests/UpdatedPersonaRequest.php
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdatedPersonaRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'apellido' => 'required|regex:/^[a-zA-ZáéíóúñÁÉÍÓÚ]+( [a-zA-ZáéíóúñÁÉÍÓÚ]+)*$/|max:20|unique:persona,apellido,' . $this->route('persona') . ',id_persona',
|
||||
'nombre' => 'required|regex:/^[a-zA-ZáéíóúñÁÉÍÓÚ]+( [a-zA-ZáéíóúñÁÉÍÓÚ]+)*$/|max:20|unique:persona,nombre,' . $this->route('persona') . ',id_persona',
|
||||
'dni' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
public function messages() {
|
||||
|
||||
return [
|
||||
'apellido.required' => 'el campo apellido es requerido',
|
||||
'apellido.regex' => 'el campo apellido solo debe contener letras',
|
||||
'apellido.max' => 'el campo apellido debe contener un maximo de 20 caracteres',
|
||||
'apellido.unique' => 'ya existe este apellido',
|
||||
'nombre.required' => 'el campo nombre es requerido',
|
||||
'nombre.regex' => 'el campo nombre solo debe contener letras',
|
||||
'nombre.max' => 'el campo nombre debe contener un maximo de 20 caracteres',
|
||||
'nombre.unique' => 'ya existe este nombre',
|
||||
'dni' => 'el campo dni es requerido'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,8 @@
|
|||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
|
@ -19,6 +21,6 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
Schema::defaultStringLength(191);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
"guzzlehttp/guzzle": "^7.2",
|
||||
"laravel/framework": "^10.10",
|
||||
"laravel/sanctum": "^3.3",
|
||||
"laravel/tinker": "^2.8"
|
||||
"laravel/tinker": "^2.8",
|
||||
"laravel/ui": "^4.6"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
|
|
|
|||
65
composer.lock
generated
65
composer.lock
generated
|
|
@ -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": "9c491b8531eec05ba41a11d9276a5749",
|
||||
"content-hash": "dcbbd52cf3c38d0f1b88e12d39e47db7",
|
||||
"packages": [
|
||||
{
|
||||
"name": "brick/math",
|
||||
|
|
@ -1512,6 +1512,69 @@
|
|||
},
|
||||
"time": "2026-02-06T14:12:35+00:00"
|
||||
},
|
||||
{
|
||||
"name": "laravel/ui",
|
||||
"version": "v4.6.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/laravel/ui.git",
|
||||
"reference": "ff27db15416c1ed8ad9848f5692e47595dd5de27"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/laravel/ui/zipball/ff27db15416c1ed8ad9848f5692e47595dd5de27",
|
||||
"reference": "ff27db15416c1ed8ad9848f5692e47595dd5de27",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/console": "^9.21|^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/filesystem": "^9.21|^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/support": "^9.21|^10.0|^11.0|^12.0|^13.0",
|
||||
"illuminate/validation": "^9.21|^10.0|^11.0|^12.0|^13.0",
|
||||
"php": "^8.0",
|
||||
"symfony/console": "^6.0|^7.0|^8.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"orchestra/testbench": "^7.35|^8.15|^9.0|^10.0|^11.0",
|
||||
"phpunit/phpunit": "^9.3|^10.4|^11.5|^12.5|^13.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"Laravel\\Ui\\UiServiceProvider"
|
||||
]
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "4.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Laravel\\Ui\\": "src/",
|
||||
"Illuminate\\Foundation\\Auth\\": "auth-backend/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"description": "Laravel UI utilities and presets.",
|
||||
"keywords": [
|
||||
"laravel",
|
||||
"ui"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/laravel/ui/tree/v4.6.3"
|
||||
},
|
||||
"time": "2026-03-17T13:41:52+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/commonmark",
|
||||
"version": "2.8.2",
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
}
|
||||
};
|
||||
|
|
@ -6,8 +6,11 @@
|
|||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@popperjs/core": "^2.11.6",
|
||||
"axios": "^1.6.4",
|
||||
"bootstrap": "^5.2.3",
|
||||
"laravel-vite-plugin": "^1.0.0",
|
||||
"sass": "^1.56.1",
|
||||
"vite": "^5.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
4
resources/js/bootstrap.js
vendored
4
resources/js/bootstrap.js
vendored
|
|
@ -1,3 +1,5 @@
|
|||
import 'bootstrap';
|
||||
|
||||
/**
|
||||
* We'll load the axios HTTP library which allows us to easily issue requests
|
||||
* to our Laravel back-end. This library automatically handles sending the
|
||||
|
|
@ -24,7 +26,7 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|||
// broadcaster: 'pusher',
|
||||
// key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||
// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
|
||||
// wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
|
||||
// wsHost: import.meta.env.VITE_PUSHER_HOST ?? `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
|
||||
// wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
|
||||
// wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
|
||||
// forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
|
||||
|
|
|
|||
7
resources/sass/_variables.scss
Normal file
7
resources/sass/_variables.scss
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
// Body
|
||||
$body-bg: #f8fafc;
|
||||
|
||||
// Typography
|
||||
$font-family-sans-serif: 'Nunito', sans-serif;
|
||||
$font-size-base: 0.9rem;
|
||||
$line-height-base: 1.6;
|
||||
8
resources/sass/app.scss
Normal file
8
resources/sass/app.scss
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
// Fonts
|
||||
@import url('https://fonts.bunny.net/css?family=Nunito');
|
||||
|
||||
// Variables
|
||||
@import 'variables';
|
||||
|
||||
// Bootstrap
|
||||
@import 'bootstrap/scss/bootstrap';
|
||||
73
resources/views/auth/login.blade.php
Normal file
73
resources/views/auth/login.blade.php
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Login') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('login') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="checkbox" name="remember" id="remember" {{ old('remember') ? 'checked' : '' }}>
|
||||
|
||||
<label class="form-check-label" for="remember">
|
||||
{{ __('Remember Me') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-8 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Login') }}
|
||||
</button>
|
||||
|
||||
@if (Route::has('password.request'))
|
||||
<a class="btn btn-link" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
49
resources/views/auth/passwords/confirm.blade.php
Normal file
49
resources/views/auth/passwords/confirm.blade.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Confirm Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
{{ __('Please confirm your password before continuing.') }}
|
||||
|
||||
<form method="POST" action="{{ route('password.confirm') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="current-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-8 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Confirm Password') }}
|
||||
</button>
|
||||
|
||||
@if (Route::has('password.request'))
|
||||
<a class="btn btn-link" href="{{ route('password.request') }}">
|
||||
{{ __('Forgot Your Password?') }}
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
47
resources/views/auth/passwords/email.blade.php
Normal file
47
resources/views/auth/passwords/email.blade.php
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form method="POST" action="{{ route('password.email') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Send Password Reset Link') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
65
resources/views/auth/passwords/reset.blade.php
Normal file
65
resources/views/auth/passwords/reset.blade.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Reset Password') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('password.update') }}">
|
||||
@csrf
|
||||
|
||||
<input type="hidden" name="token" value="{{ $token }}">
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ $email ?? old('email') }}" required autocomplete="email" autofocus>
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-end">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Reset Password') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
77
resources/views/auth/register.blade.php
Normal file
77
resources/views/auth/register.blade.php
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Register') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('register') }}">
|
||||
@csrf
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="name" class="col-md-4 col-form-label text-md-end">{{ __('Name') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="name" type="text" class="form-control @error('name') is-invalid @enderror" name="name" value="{{ old('name') }}" required autocomplete="name" autofocus>
|
||||
|
||||
@error('name')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="email" class="col-md-4 col-form-label text-md-end">{{ __('Email Address') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="email" type="email" class="form-control @error('email') is-invalid @enderror" name="email" value="{{ old('email') }}" required autocomplete="email">
|
||||
|
||||
@error('email')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password" class="col-md-4 col-form-label text-md-end">{{ __('Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password" type="password" class="form-control @error('password') is-invalid @enderror" name="password" required autocomplete="new-password">
|
||||
|
||||
@error('password')
|
||||
<span class="invalid-feedback" role="alert">
|
||||
<strong>{{ $message }}</strong>
|
||||
</span>
|
||||
@enderror
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="password-confirm" class="col-md-4 col-form-label text-md-end">{{ __('Confirm Password') }}</label>
|
||||
|
||||
<div class="col-md-6">
|
||||
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required autocomplete="new-password">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-0">
|
||||
<div class="col-md-6 offset-md-4">
|
||||
<button type="submit" class="btn btn-primary">
|
||||
{{ __('Register') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
28
resources/views/auth/verify.blade.php
Normal file
28
resources/views/auth/verify.blade.php
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Verify Your Email Address') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('resent'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ __('A fresh verification link has been sent to your email address.') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('Before proceeding, please check your email for a verification link.') }}
|
||||
{{ __('If you did not receive the email') }},
|
||||
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">{{ __('click here to request another') }}</button>.
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
9
resources/views/compartido/errores.blade.php
Normal file
9
resources/views/compartido/errores.blade.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
3
resources/views/compartido/mensajes.blade.php
Normal file
3
resources/views/compartido/mensajes.blade.php
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
@if (session('mensaje-success'))
|
||||
<p class="alert alert-success">{{ session('mensaje-success') }}</p>
|
||||
@endif
|
||||
23
resources/views/home.blade.php
Normal file
23
resources/views/home.blade.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">{{ __('Dashboard') }}</div>
|
||||
|
||||
<div class="card-body">
|
||||
@if (session('status'))
|
||||
<div class="alert alert-success" role="alert">
|
||||
{{ session('status') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{ __('You are logged in!') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
103
resources/views/layouts/admin.blade.php
Normal file
103
resources/views/layouts/admin.blade.php
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
<!doctype html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<!-- viewport => hace que el sitio sea responsive en móviles -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<!-- Token CSRF de Laravel para proteger formularios -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<!-- yield => permite que cada vista defina su título; si no lo define, se usa "MiApp" -->
|
||||
<title>@yield('title','proyecto_taller')</title>
|
||||
|
||||
<!-- Bootstrap CSS v4.6.2:
|
||||
- framework que da estilos listos para botones, formularios, grillas, etc. -->
|
||||
<link rel="stylesheet"
|
||||
href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
|
||||
|
||||
<!-- FontAwesome:
|
||||
- librería de íconos (ej: fa-eye, fa-pencil, fa-remove, etc.). -->
|
||||
<link rel="stylesheet"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
<!-- DataTables: -->
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.8/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.bootstrap4.min.css">
|
||||
<!-- @stack('styles') => permite que otras vistas agreguen CSS extra en esta sección -->
|
||||
@stack('styles')
|
||||
</head>
|
||||
<body>
|
||||
<!-- navbar => barra de navegación de Bootstrap -->
|
||||
<!-- navbar-expand-lg => se expande en pantallas grandes (LG) -->
|
||||
<!-- navbar-light => estilo de texto oscuro sobre fondo claro -->
|
||||
<!-- bg-light => fondo gris claro -->
|
||||
|
||||
<nav class="navbar navbar-expand-lg bg-light">
|
||||
|
||||
<!-- Nombre de la aplicación -->
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
proyecto_taller
|
||||
</a>
|
||||
|
||||
<!-- Menú principal -->
|
||||
<ul class="navbar-nav">
|
||||
|
||||
<!-- Categorías -->
|
||||
<li class="nav-item dropdown">
|
||||
|
||||
<a class="nav-link dropdown-toggle"
|
||||
href="#"
|
||||
data-toggle="dropdown">
|
||||
|
||||
PERSONAS
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu">
|
||||
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('personas.index') }}">
|
||||
|
||||
Listado
|
||||
</a>
|
||||
|
||||
<a class="dropdown-item"
|
||||
href="{{ route('personas.create') }}">
|
||||
|
||||
Nueva Persona
|
||||
</a>
|
||||
|
||||
</div>
|
||||
|
||||
</li>
|
||||
|
||||
|
||||
</ul>
|
||||
|
||||
</nav>
|
||||
<!-- container => centra el contenido y le da márgenes automáticos laterales -->
|
||||
<!-- py-4 => padding vertical (arriba y abajo) de 1.5rem (~24px) -->
|
||||
<div class="container py-4">
|
||||
<!-- yield('contenido') => espacio donde cada vista Blade inyecta su propio contenido -->
|
||||
@yield('contenido')
|
||||
</div>
|
||||
|
||||
<!-- Dependencias JS -->
|
||||
<!-- jQuery => requerido por Bootstrap 4 -->
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
|
||||
<!-- Popper.js => requerido para tooltips, dropdowns y menús flotantes -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
|
||||
<!-- Bootstrap JS => activa componentes interactivos como modales, menús, tooltips -->
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- DataTables -->
|
||||
<script src="https://cdn.datatables.net/1.13.8/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.8/js/dataTables.bootstrap4.min.js"></script>
|
||||
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.bootstrap4.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
|
||||
|
||||
<!-- stack('scripts') => permite que otras vistas agreguen scripts extra -->
|
||||
@stack('scripts')
|
||||
</body>
|
||||
</html>
|
||||
91
resources/views/layouts/app.blade.php
Normal file
91
resources/views/layouts/app.blade.php
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
<!doctype html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<!-- CSRF Token -->
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
|
||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="dns-prefetch" href="//fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=Nunito" rel="stylesheet">
|
||||
|
||||
<!-- Bootstrap y FontAwesome por CDN-->
|
||||
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/css/bootstrap.min.css">
|
||||
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">
|
||||
|
||||
<!-- Scripts -->
|
||||
|
||||
</head>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.6.2/dist/js/bootstrap.bundle.min.js"></script>
|
||||
|
||||
<body>
|
||||
<div id="app">
|
||||
<nav class="navbar navbar-expand-md navbar-light bg-white shadow-sm">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="{{ url('/') }}">
|
||||
{{ config('app.name', 'Laravel') }}
|
||||
</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="{{ __('Toggle navigation') }}">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<!-- Left Side Of Navbar -->
|
||||
<ul class="navbar-nav me-auto">
|
||||
|
||||
</ul>
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<!-- Authentication Links -->
|
||||
@guest
|
||||
@if (Route::has('login'))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('login') }}">{{ __('Login') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
@if (Route::has('register'))
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('register') }}">{{ __('Register') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@else
|
||||
<li class="nav-item dropdown">
|
||||
<a id="navbarDropdown" class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
{{ Auth::user()->name }}
|
||||
</a>
|
||||
|
||||
<div class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
{{ __('Logout') }}
|
||||
</a>
|
||||
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
</div>
|
||||
</li>
|
||||
@endguest
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="py-4">
|
||||
@yield('content')
|
||||
</main>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,42 +1,80 @@
|
|||
<!doctype html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Editar persona</title>
|
||||
</head>
|
||||
<body>
|
||||
@extends('layouts.admin')
|
||||
@section('contenido')
|
||||
|
||||
<h1>Editar persona</h1>
|
||||
<!-- row => fila del sistema de grillas de Bootstrap
|
||||
justify-content-center => centra horizontalmente el contenido dentro de la fila
|
||||
align-items-center => alinea verticalmente los elementos de la fila -->
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<!-- col-lg-11 col-md-11 col-sm-11 col-xs-11 =>
|
||||
la columna ocupa 11/12 partes en todos los tamaños de pantalla -->
|
||||
<div class="col-lg-11 col-md-11 col-sm-11 col-xs-11">
|
||||
<h3>Editar Persona</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
|
||||
<form method="POST" action="{{ route('personas.update', $per->id_persona) }}">
|
||||
<!-- Includes de Blade para mensajes de éxito y errores -->
|
||||
@include('compartido.mensajes')
|
||||
@include('compartido.errores')
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!-- Formulario de edición de categoría -->
|
||||
<form method="POST"
|
||||
action="{{ route('personas.update', $per->id_persona) }}"
|
||||
enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@method('PUT') <!-- Indica a Laravel que el método real es PUT -->
|
||||
|
||||
<div>
|
||||
<label for="apellido">Apellido *</label><br>
|
||||
<input id="apellido" name="apellido" type="text"
|
||||
value="{{ old('apellido', $per->apellido) }}" required>
|
||||
<!-- row => agrupa los campos en una fila -->
|
||||
<div class="row">
|
||||
<!-- form-group => añade márgenes y separación entre los campos -->
|
||||
<!-- col-md-3 => cada campo ocupa 3/12 columnas en pantallas medianas o más grandes -->
|
||||
<div class="form-group col-md-3">
|
||||
<!-- form-check-label => estilo Bootstrap para etiquetas de formulario -->
|
||||
<label for="apellido" class="form-check-label">Apellido (*)</label>
|
||||
<!-- form-control => da estilo uniforme al input -->
|
||||
<input type="text" name="apellido" id="apellido" class="form-control"
|
||||
value="{{ old('apellido', $per->apellido) }}" >
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="nombre" class="form-check-label">Nombre (*)</label>
|
||||
<input type="text" name="nombre" id="nombre" class="form-control"
|
||||
value="{{ old('nombre', $per->nombre) }}" >
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="dni" class="form-check-label">DNI (*)</label>
|
||||
<input type="number" name="dni" id="dni" class="form-control"
|
||||
value="{{ old('dni', $per->dni) }}" >
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label for="nombre">Nombre *</label><br>
|
||||
<input id="nombre" name="nombre" type="text"
|
||||
value="{{ old('nombre', $per->nombre) }}" required>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:8px;">
|
||||
<label for="dni">DNI</label><br>
|
||||
<input id="dni" name="dni" type="text"
|
||||
value="{{ old('dni', $per->dni) }}">
|
||||
</div>
|
||||
|
||||
<div style="margin-top:12px;">
|
||||
<button type="submit">Guardar</button>
|
||||
<a href="{{ route('personas.index') }}">Volver al listado</a>
|
||||
<!-- row justify-content-center align-items-center =>
|
||||
fila que centra horizontal y verticalmente los botones -->
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-md-2">
|
||||
<!-- btn => clase base de Bootstrap para botones
|
||||
btn-success => verde (acción positiva)
|
||||
btn-block => ocupa todo el ancho de la columna
|
||||
btn-lg => tamaño grande -->
|
||||
<button class="btn btn-success btn-block btn-lg">Guardar</button>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<!-- btn-primary => azul (acción principal)
|
||||
title="Salir" => tooltip al pasar el mouse -->
|
||||
<a href="{{ route('personas.index') }}" class="btn btn-primary btn-block btn-lg" title="Salir">Salir</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
//Aquí se pueden agregar scripts específicos de esta vista -->
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -1,51 +1,130 @@
|
|||
<!doctype html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<title>Personas</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
<a href="{{ route('personas.create') }}">Nueva persona</a>
|
||||
</p>
|
||||
<ul>
|
||||
@foreach($personas as $per)
|
||||
<li>
|
||||
<strong>{{ $per->apellido }}</strong>
|
||||
— {{ $per->nombre }}
|
||||
— {{ $per->dni }}
|
||||
(ID: {{ $per->id_persona}})
|
||||
|
|
||||
|
||||
@if($per->trashed())
|
||||
@extends('layouts.admin')
|
||||
@section('contenido')
|
||||
|
||||
<form action="{{ route('personas.restaurar', $per->id_persona) }}"
|
||||
method="POST" >
|
||||
@csrf
|
||||
@method('PUT')
|
||||
<button onclick="return confirm('¿Restaurar esta persona?')">
|
||||
Restaurar persona
|
||||
</button>
|
||||
</form>
|
||||
<!-- row => fila del sistema de grillas Bootstrap
|
||||
justify-content-center => centra horizontalmente los contenidos
|
||||
align-items-center => centra verticalmente
|
||||
no centran el texto, centran las columnas dentro de la fila
|
||||
-->
|
||||
|
||||
@else
|
||||
<a href="{{ route('personas.show', $per->id_persona) }}">Ver Más</a>
|
||||
|
|
||||
<a href="{{ route('personas.edit', $per->id_persona) }}">Editar </a>
|
||||
<form action="{{ route('personas.destroy', $per->id_persona) }}"
|
||||
method="POST" >
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button onclick="return confirm('¿Eliminar esta persona?')">
|
||||
Eliminar
|
||||
</button>
|
||||
</form>
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<!-- col-12 => ocupa todo el ancho en pantallas pequeñas
|
||||
col-md-11 => ocupa 11/12 del ancho en pantallas medianas o mayores -->
|
||||
<div class="col-12 col-md-11">
|
||||
<h3>Listado de Personas</h3>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--<a href="{{ route('personas.edit', $per->id_personas) }}">Editar</a>
|
||||
--}}
|
||||
@endif
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-md-2">
|
||||
<!-- btn => estilo de botón Bootstrap
|
||||
btn-success => verde (acción positiva)
|
||||
btn-block => ocupa todo el ancho de la columna
|
||||
btn-lg => tamaño grande -->
|
||||
<a href="{{ route('personas.create') }}"
|
||||
class="btn btn-success btn-block btn-lg"
|
||||
title="Nueva Persona">
|
||||
Nuevo
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<br>
|
||||
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-12 col-md-11">
|
||||
|
||||
<!-- Includes de Blade para mensajes de éxito y errores -->
|
||||
@include('compartido.mensajes')
|
||||
@include('compartido.errores')
|
||||
|
||||
<!-- table-responsive => hace que la tabla sea "scrollable" en pantallas pequeñas -->
|
||||
<div class="table-responsive">
|
||||
|
||||
<!-- table => tabla con estilos básicos
|
||||
table-striped => filas alternadas con fondo gris
|
||||
table-bordered => agrega bordes a todas las celdas
|
||||
table-hover => resalta la fila al pasar el mouse -->
|
||||
<table class="table table-striped table-bordered table-hover" id="example">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Apellido</th>
|
||||
<th>Nombre</th>
|
||||
<th>DNI</th>
|
||||
<th>Acciones</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($persona as $per)
|
||||
<tr>
|
||||
<td>{{ $per->id_persona }}</td>
|
||||
<td>{{ $per->apellido }}</td>
|
||||
<td>{{ $per->nombre }}</td>
|
||||
<td>{{ $per->dni }}</td>
|
||||
<td align="center">
|
||||
|
||||
@if($per->deleted_at == null)
|
||||
<form method="POST" action="{{ route('personas.destroy', $per->id_persona) }}" style="display:inline;">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
|
||||
<!-- btn-info => azul claro (información) -->
|
||||
<a class="btn btn-info"
|
||||
href="{{ route('personas.show', $per->id_persona) }}"
|
||||
title="Ver más">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
|
||||
<!-- btn-warning => amarillo (advertencia / editar) -->
|
||||
<a class="btn btn-warning"
|
||||
href="{{ route('personas.edit', $per->id_persona) }}"
|
||||
title="Editar">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
|
||||
<!-- btn-danger => rojo (acción destructiva como eliminar) -->
|
||||
<button class="btn btn-danger"
|
||||
onclick="return confirm('¿Está seguro de eliminar?');"
|
||||
title="Eliminar">
|
||||
<i class="fa fa-remove"></i>
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<form method="POST" action="{{ route('personas.restaurar', $per->id_persona) }}" style="display:inline;">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<!-- btn-danger => rojo (acción destructiva como eliminar) -->
|
||||
<button class="btn btn-success"
|
||||
onclick="return confirm('¿Está seguro de Restaurar a esta persona?');"
|
||||
title="Restaurar">
|
||||
<i class="fa fa-undo"></i>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
@push('styles')
|
||||
|
||||
@endpush
|
||||
@push('scripts')
|
||||
<script>
|
||||
// DataTables (plugin JS para mejorar tablas: búsqueda, paginación, exportación)
|
||||
$('#example').DataTable({
|
||||
dom: 'Bfrtip',
|
||||
buttons: ['excel'],
|
||||
pageLength: 5,
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -1,37 +1,75 @@
|
|||
<!doctype html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Nueva persona</title>
|
||||
</head>
|
||||
<body>
|
||||
@extends('layouts.admin')
|
||||
@section ('contenido')
|
||||
|
||||
<h1>Nueva persona</h1>
|
||||
<!-- row => fila del sistema de grillas de Bootstrap
|
||||
justify-content-center => centra horizontalmente el contenido dentro de la fila
|
||||
align-items-center => centra verticalmente los elementos dentro de la fila -->
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<!-- col-lg-11 col-md-11 col-sm-11 col-xs-11 =>
|
||||
la columna ocupa 11/12 partes del ancho en todos los tamaños de pantalla -->
|
||||
<div class="col-lg-11 col-md-11 col-sm-11 col-xs-11">
|
||||
<h3>Nueva Persona</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-10">
|
||||
|
||||
<form method="POST" action="{{ route('personas.store') }}">
|
||||
@csrf
|
||||
<!-- Includes de Blade para mensajes de éxito y errores -->
|
||||
@include('compartido.mensajes')
|
||||
@include('compartido.errores')
|
||||
</div>
|
||||
</div>
|
||||
</br>
|
||||
|
||||
<div>
|
||||
<label for="apellido">Apellido *</label><br>
|
||||
<input id="apellido" name="apellido" type="text" value="{{ old('apellido') }}" required>
|
||||
</div>
|
||||
<!-- Formulario para crear nueva categoría -->
|
||||
<form method="post" action="{{ route('personas.store') }}" enctype=multipart/form-data>
|
||||
@csrf
|
||||
|
||||
<!-- row => agrupa los campos en una fila -->
|
||||
<div class="row">
|
||||
<!-- form-group => separa cada campo del formulario con márgenes
|
||||
col-md-3 => ocupa 3/12 columnas en pantallas medianas hacia arriba -->
|
||||
<div class="form-group col-md-3">
|
||||
<!-- form-check-label => clase de Bootstrap que estiliza etiquetas de formulario -->
|
||||
<label for="apellido" class="form-check-label">Apellido (*)</label>
|
||||
<!-- form-control => aplica estilos consistentes al input-->
|
||||
<input type="text" name="apellido" id="apellido" value="{{old('apellido')}}" required class="form-control" >
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="nombre">Nombre *</label><br>
|
||||
<input id="nombre" name="nombre" type="text" value="{{ old('nombre') }}" required>
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="nombre" class="form-check-label">Nombre (*)</label>
|
||||
<input type="text" name="nombre" id="nombre" value="{{old('nombre')}}" class="form-control">
|
||||
</div>
|
||||
|
||||
<div style="margin-top:8px;">
|
||||
<label for="dni">DNI</label><br>
|
||||
<input id="dni" name="dni" type="text" value="{{ old('dni') }}">
|
||||
</div>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="dni" class="form-check-label">DNI (*)</label>
|
||||
<input type="number" name="dni" id="dni" value="{{old('dni')}}" class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin-top:12px;">
|
||||
<button type="submit">Guardar</button>
|
||||
<a href="{{ route('personas.index') }}">Volver al listado</a>
|
||||
</div>
|
||||
|
||||
<!-- row justify-content-center align-items-center =>
|
||||
crea una fila y centra horizontal y verticalmente los botones -->
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-md-2">
|
||||
<!-- btn => botón base de Bootstrap
|
||||
btn-success => color verde
|
||||
btn-block => ocupa todo el ancho de la columna
|
||||
btn-lg => tamaño grande -->
|
||||
<button class="btn btn-success btn-block btn-lg">Guardar</button>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<!-- btn-primary => color azul
|
||||
title="Salir" => muestra tooltip al pasar el mouse -->
|
||||
<a href="{{ route('personas.index') }}" class="btn btn-primary btn-block btn-lg" title="Salir">Salir</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@endsection
|
||||
|
||||
@push('scripts')
|
||||
<script>
|
||||
//Aquí podrías agregar código JavaScript específico para esta vista
|
||||
</script>
|
||||
@endpush
|
||||
|
|
|
|||
|
|
@ -1,37 +1,34 @@
|
|||
<!doctype html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Ver persona</title>
|
||||
</head>
|
||||
<body>
|
||||
@extends('layouts.admin')
|
||||
@section ('contenido')
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-lg-11 col-md-11 col-sm-11 col-xs-11">
|
||||
<h3>Ver Persona</h3>
|
||||
<div class="progress" style="height: 2px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</br>
|
||||
<div class="row">
|
||||
<div class="form-group col-md-3">
|
||||
<label for="apellido" class="form-check-label">Apellido (*)</label>
|
||||
<input type="text" name="apellido" id="apellido" class="form-control" value="{{$per->apellido}}" readonly>
|
||||
</div>
|
||||
|
||||
<h1>Ver persona</h1>
|
||||
<div class="form-group col-md-3">
|
||||
<label for="nombre" class="form-check-label">Nombre (*)</label>
|
||||
<input type="text" name="nombre" id="nombre" class="form-control" value="{{$per->nombre}}" readonly>
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-3">
|
||||
<label for="dni" class="form-check-label">DNI (*)</label>
|
||||
<input type="text" name="dni" id="dni" class="form-control" value="{{$per->dni}}" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<legend></legend>
|
||||
<div class="row justify-content-center align-items-center">
|
||||
<div class="col-md-2">
|
||||
<a href="{{ route('personas.index') }}" class="btn btn-primary btn-block btn-lg" title="Salir">Salir</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="apellido">Apellido *</label><br>
|
||||
<input id="apellido" name="apellido" readonly type="text"
|
||||
value="{{ $per->apellido }}" >
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="nombre">Nombre *</label><br>
|
||||
<input id="nombre" name="nombre" readonly type="text"
|
||||
value="{{ $per->nombre }}" >
|
||||
</div>
|
||||
|
||||
<div style="margin-top:8px;">
|
||||
<label for="dni">DNI</label><br>
|
||||
<input id="dni" readonly name="dni" type="text"
|
||||
value="{{ $per->dni }}">
|
||||
</div>
|
||||
|
||||
<div style="margin-top:12px;">
|
||||
<a href="{{ route('personas.index') }}">Volver al listado</a>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@endsection
|
||||
|
|
@ -17,4 +17,7 @@ Route::get('personas/{persona}/edit', [PersonaController::class, 'edit'])->name(
|
|||
Route::put('personas/{persona}', [PersonaController::class, 'update'])->name('personas.update');*/
|
||||
|
||||
Route::resource('personas', PersonaController::class);
|
||||
Route::put('personas/restaurar/{persona}', [PersonaController::class, 'restaurar'])->name('personas.restaurar');
|
||||
Route::put('personas/restaurar/{persona}', [PersonaController::class, 'restaurar'])->name('personas.restaurar');
|
||||
Auth::routes();
|
||||
|
||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||
|
|
|
|||
|
|
@ -4,7 +4,10 @@ import laravel from 'laravel-vite-plugin';
|
|||
export default defineConfig({
|
||||
plugins: [
|
||||
laravel({
|
||||
input: ['resources/css/app.css', 'resources/js/app.js'],
|
||||
input: [
|
||||
'resources/sass/app.scss',
|
||||
'resources/js/app.js',
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user