diff --git a/app/Http/Middleware/Compras.php b/app/Http/Middleware/Compras.php new file mode 100644 index 0000000..8852113 --- /dev/null +++ b/app/Http/Middleware/Compras.php @@ -0,0 +1,26 @@ +is_compras) { + return $next($request); + } else { + return response('Necesitás ser de comisión compras para hacer esto', 403); + } + } +} diff --git a/database/migrations/2024_08_28_000025_agregar_is_compras_a_user.php b/database/migrations/2024_08_28_000025_agregar_is_compras_a_user.php new file mode 100644 index 0000000..57d12ac --- /dev/null +++ b/database/migrations/2024_08_28_000025_agregar_is_compras_a_user.php @@ -0,0 +1,32 @@ +boolean('is_compras')->after('is_admin')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('producto_subpedido', function (Blueprint $table) { + $table->dropColumn('is_compras'); + }); + } +}