You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, Leaf automatically passes in some useful props into your inertia views. These include:
67
+
68
+
-`auth`: The current auth context, including:
69
+
-`user`: The currently authenticated user, or `null` if not authenticated.
70
+
-`id`: The ID of the currently authenticated user, or `null` if not authenticated.
71
+
-`errors`: Any authentication errors that might have occurred during login or registration.
72
+
-`permissions`: The permissions of the currently authenticated user if in use.
73
+
-`roles`: The roles of the currently authenticated user if in use.
74
+
-`hasSubscription`: Whether the currently authenticated user has an active subscription if using Leaf's billing features.
75
+
-`subscription`: The current subscription of the authenticated user if using Leaf's billing features.
76
+
-`isOnTrial`: Whether the currently authenticated user is on a trial if using Leaf's billing features.
77
+
-`flash`: The default flash message or `null` if none exists.
78
+
-`session`: The current session data, excluding flash messages and hidden data.
79
+
-`billing`: The billing context if using Leaf's billing features, including:
80
+
-`tiers`: The available billing tiers.
81
+
-`periods`: The available billing periods.
82
+
-`_token`: The current CSRF token if CSRF protection is enabled.
83
+
84
+
:::
85
+
64
86
## Accessing data passed into views
65
87
66
88
In the example above, we passed in some data from our application into our inertia view. Remember, Inertia views can be React, Vue or Svelte files, and any data we pass in from our app can be accessed as a prop like this:
0 commit comments