PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

How can I display only the data of the currently logged-in user who added this? 

Solved
cpshibinoppo

Nov 30th, 2022 02:49 AM

How can I display only the data of the currently logged-in user who added this? 

bobbyiliev

Nov 30th, 2022 02:52 AM

Best Answer

Hi there,

You can do this by using the auth()->user() helper function, for example to get the posts for the currently authenticated user you could do the following:

$user = auth()->user();
$allpost = $user->posts()->get();
var_dump($allpost);

If you are referring to Voyager, then you could od that by following the steps here:

How to apply multi-tenancy in Laravel Voyager

Report
1