1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Http/Controllers/UserController.php

134 lines
2.8 KiB
PHP
Raw Normal View History

<?php
2019-05-11 05:32:07 +02:00
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Controllers;
2019-04-27 11:20:03 +02:00
use App\Factory\UserFactory;
2019-04-25 13:33:03 +02:00
use App\Filters\UserFilters;
use App\Http\Controllers\Traits\VerifiesUserEmail;
2019-04-27 11:20:03 +02:00
use App\Http\Requests\User\CreateUserRequest;
use App\Http\Requests\User\DestroyUserRequest;
use App\Http\Requests\User\EditUserRequest;
use App\Http\Requests\User\ShowUserRequest;
use App\Http\Requests\User\StoreUserRequest;
use App\Http\Requests\User\UpdateUserRequest;
2019-04-25 13:33:03 +02:00
use App\Models\User;
use App\Transformers\UserTransformer;
use App\Utils\Traits\MakesHash;
use Illuminate\Http\Request;
2019-01-27 00:22:57 +01:00
/**
* Class UserController
* @package App\Http\Controllers
*/
2019-03-28 22:34:58 +01:00
class UserController extends BaseController
{
use VerifiesUserEmail;
2019-04-25 13:33:03 +02:00
use MakesHash;
protected $entity_type = User::class;
protected $entity_transformer = UserTransformer::class;
2019-03-28 22:34:58 +01:00
public function __construct()
{
parent::__construct();
2019-03-28 22:34:58 +01:00
}
2019-04-25 13:33:03 +02:00
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(UserFilters $filster)
{
$users = User::filter($filters);
return $this->listResponse($users);
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
2019-04-27 11:20:03 +02:00
public function create(CreateUserRequest $request)
2019-04-25 13:33:03 +02:00
{
2019-04-27 11:20:03 +02:00
$user = UserFactory::create();
return $this->itemResponse($user);
2019-04-25 13:33:03 +02:00
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
2019-04-27 11:20:03 +02:00
public function store(StoreUserRequest $request)
2019-04-25 13:33:03 +02:00
{
2019-04-28 12:25:18 +02:00
//save user
//attach user to company
2019-04-25 13:33:03 +02:00
}
/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
2019-04-27 11:20:03 +02:00
public function show(ShowUserRequest $request)
2019-04-25 13:33:03 +02:00
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
2019-04-27 11:20:03 +02:00
public function edit(EditUserRequest $request)
2019-04-25 13:33:03 +02:00
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
2019-06-05 02:43:23 +02:00
public function update(UpdateUserRequest $request, User $user)
2019-04-25 13:33:03 +02:00
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
2019-04-27 11:20:03 +02:00
public function destroy(DestroyUserRequest $request)
2019-04-25 13:33:03 +02:00
{
//
}
}