Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

inertiajs/pingcrm

2292 stars
1 code files
View inertiajs/pingcrm on GitHub

app/Http/Controllers/UsersController.php

Open in GitHub
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Request;
use Inertia\Inertia;
 
class UsersController extends Controller
{
public function index()
{
return Inertia::render('Users/Index', [
'filters' => Request::all('search', 'role', 'trashed'),
'users' => Auth::user()->account->users()
->orderByName()
->filter(Request::only('search', 'role', 'trashed'))
->get()
->transform(fn ($user) => [
'id' => $user->id,
'name' => $user->name,
'email' => $user->email,
'owner' => $user->owner,
'photo' => $user->photo_path ? URL::route('image', ['path' => $user->photo_path, 'w' => 40, 'h' => 40, 'fit' => 'crop']) : null,
'deleted_at' => $user->deleted_at,
]),
]);
}
//
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.