Member Since 2 Years Ago
2,440 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Replied to Inertia Link Server Side
Actually I can store "<inertia-link></inertia-link>
" on the database and then pass it as a template to a vue component and it gets compiled to a link.
So turns out this is possible. In case anyone is curious about the solution I can try to provide the elements needed to achieve this.
Started a new Conversation Inertia Link Server Side
Is it possible to generate "inertia-links" on the server side?
I'm working on a CMS and I would like the links inside the content (created by the user with a text field) of a page to act as inertia-links, hence load the page content without reloading the page.
Example:
<template>
<div v-html="content"></div>
</template>
<script>
export default {
data() : {
content: '<p>This is a paragraph...</p><inertia-link :href="/link-to-other-page">Link to other page</inertia-link>'
}
}
</script>
Wanted behaviour: if someone clicks on the link "Link to other page" we load the page dynamically.
Is there an existing or correct way to pass an html content to a vue template containing a link and making it so that when the html content is rendered and someone clicks on the link the page content is loaded dynamically without reloading the page?
Hope I made myself clear...
Started a new Conversation Sanctum, Abilities, Roles And Permissions
This is more a question of "best practices" rather than giving a code solution (which I'm not after).
I'm in the process of developing a web application accompanied by a mobile app. I was looking into Sanctum and the possibility of passing abilities when creating a Token.
Given that I'll be using Role, Permissions (spatie/laravel-permission
package) and Policies for the web app, is it recommended to relie on the same authorisation checks also for the mobile or should I make different policies?
For example, let's say that I have a policy to limit the creation of posts to users having the role of editor
with permission create post
. Should I grant the same permission/ability to the token associated to that same user on the mobile app and on the same policy check if $request->expectsJson()
then check the token capabilities, otherwise check the user's roles and permissions?
Would this be the right approach or is it better to separate the token based logic (and policies) from the web based one?
Replied to BelongsTo Relationship + Main Contact
Yes indeed, little problem that I noticed while I was doing a migrate:refresh
. Good to know though!
Thanks again and have a nice day!
Replied to BelongsTo Relationship + Main Contact
Yes, I was after some suggestions on best practices more than actual codes. Appreciate very much your response.
I was also going for this kind of structure where a company has a contact_id
linked to the users
table. So unless anyone else comes up with some valid alternative solution I guess I'll just stick to this one.
Thanks again!
Replied to BelongsTo Relationship + Main Contact
Yes of course, maybe I wasn't clear enough, but what I would like to understand is what would be the best approach to say the user A who belongs to company X is also its main contact.
Where and how would I store this information? Should I:
users
table named is_main_contact
?main_contact_id
in the companies
table assigning it a foreign key to the users
table?What would be the best approach to handle the main contact feature?
Started a new Conversation BelongsTo Relationship + Main Contact
What would be the best way to have this relation:
A company can have many users, a User belongs to one company and each company has a main contact (user).
And by best way how should I structure the migration and relationships the two models?
Awarded Best Reply on Laravel 8 Login With Multiple Characters
My approach would be to have a Character
model and table in the DB where each character would be associated to the user who created it. Then somewhere store and handle which one is the current active character and from them load its content.
Replied to Laravel 8 Login With Multiple Characters
I'm not sure what do you mean by middleware? Based on your question it sounded more like an issue of "structure" and how to handle characters.
Laravel's definition of middleware is:
Middleware provide a convenient mechanism for filtering HTTP requests entering your application. [...]
Replied to Jetstream: Redirect After Login Based On Role
Thanks, this is exactly what I was looking for!
Replied to Laravel 8 Login With Multiple Characters
My approach would be to have a Character
model and table in the DB where each character would be associated to the user who created it. Then somewhere store and handle which one is the current active character and from them load its content.
Started a new Conversation Jetstream: Redirect After Login Based On Role
I've found many different answers on how to handle a redirection after a successful login based on user role, but what I'm looking for is the best and proper way to achieve this with Jetstream (Fortify).
For instance admin
would be redirected to '/dashboard' and user
would be redirected to '/home'.