Compare commits
No commits in common. "28b82b9789410ffa15404b85187c5ee9e3655916" and "d219a6e3e1b364442fdafdaa6b5456e2493ec3a9" have entirely different histories.
28b82b9789
...
d219a6e3e1
BIN
BD/modelo.mwb
BIN
BD/modelo.mwb
Binary file not shown.
|
|
@ -47,9 +47,10 @@ class LoginController extends Controller
|
||||||
'password' => 'required',
|
'password' => 'required',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
if (Auth::attempt($credentials)) {
|
if (Auth::attempt($credentials)) {
|
||||||
$request->session()->regenerate();
|
$request->session()->regenerate();
|
||||||
return redirect()->intended('/categorias');
|
return redirect()->intended('/dashboard'); // ruta post-login
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ class CategoriasController extends Controller
|
||||||
}
|
}
|
||||||
public function show($id){
|
public function show($id){
|
||||||
$categoria = Categorias::findOrfail($id);
|
$categoria = Categorias::findOrfail($id);
|
||||||
$categoria->formatear_texto();
|
|
||||||
return view('categorias.show', ["cat"=>$categoria]);
|
return view('categorias.show', ["cat"=>$categoria]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,10 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Http\Controllers;
|
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class ProductoController extends Controller
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
@ -5,12 +5,11 @@ namespace App\Models;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use App\Traits\Herramientas;
|
|
||||||
class Categorias extends Model
|
class Categorias extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
use Herramientas;
|
|
||||||
|
|
||||||
protected $table = 'categorias';
|
protected $table = 'categorias';
|
||||||
|
|
||||||
|
|
@ -21,6 +20,4 @@ class Categorias extends Model
|
||||||
'nombre',
|
'nombre',
|
||||||
'descripcion',
|
'descripcion',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
class CodigoBarras extends Model
|
|
||||||
{
|
|
||||||
use HasFactory;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected $table = 'codigo_barras';
|
|
||||||
|
|
||||||
public $primaryKey = 'id_codigo_barras';
|
|
||||||
|
|
||||||
public $timestamps = true;
|
|
||||||
protected $fillable = [
|
|
||||||
'codigo',
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
class Etiquetas extends Model
|
|
||||||
{
|
|
||||||
use HasFactory;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected $table = 'etiquetas';
|
|
||||||
|
|
||||||
public $primaryKey = 'id_etiqueta';
|
|
||||||
|
|
||||||
public $timestamps = true;
|
|
||||||
protected $fillable = [
|
|
||||||
'nombre',
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
@ -1,26 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
class Producto extends Model
|
|
||||||
{
|
|
||||||
use HasFactory;
|
|
||||||
use SoftDeletes;
|
|
||||||
|
|
||||||
protected $table = 'productos';
|
|
||||||
|
|
||||||
public $primaryKey = 'id_producto';
|
|
||||||
|
|
||||||
public $timestamps = true;
|
|
||||||
protected $fillable = [
|
|
||||||
'nombre',
|
|
||||||
'descripcion',
|
|
||||||
'categoria_id',
|
|
||||||
'codigo_barras_id'
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Traits;
|
|
||||||
|
|
||||||
trait Herramientas {
|
|
||||||
|
|
||||||
public function formatear_texto() {
|
|
||||||
|
|
||||||
$this->nombre = ucwords(strtolower($this->nombre));
|
|
||||||
$this->update();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -30,4 +30,5 @@ Route::put('categorias/{categoria}', [CategoriasController::class, 'update'])->n
|
||||||
Route::resource('categorias', CategoriasController::class)->middleware('auth');
|
Route::resource('categorias', CategoriasController::class)->middleware('auth');
|
||||||
Route::put('categorias/restaurar/{categoria}', [CategoriasController::class, 'restaurar'])->name('categorias.restaurar')->middleware('auth');
|
Route::put('categorias/restaurar/{categoria}', [CategoriasController::class, 'restaurar'])->name('categorias.restaurar')->middleware('auth');
|
||||||
Auth::routes();
|
Auth::routes();
|
||||||
|
|
||||||
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user