CorvS

Member Since 1 Year Ago

Frankfurt

Experience Points
69,880
Total
Experience

120 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
86
Lessons
Completed
Best Reply Awards
94
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    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.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 14
69,880 XP
Apr
13
21 hours ago
Activity icon

Awarded Best Reply on Laravel Breeze Localization

@ahangarha The docs already describe it. If you want to translate 'Dashboard' to another language, let's say Spanish, you have to create a es.json file under resources/lang and add a JSON key/value pair "Dashboard": "Dashboard in Spanish".

Activity icon

Replied to Livewire Component Problem Livewire-components.php

@faxunil Have you tried clearing your view cache using php artisan view:clear? And I'd assume you added the Livewire scripts and styles to your head and body?

Activity icon

Replied to Laravel Breeze Localization

@ahangarha The docs already describe it. If you want to translate 'Dashboard' to another language, let's say Spanish, you have to create a es.json file under resources/lang and add a JSON key/value pair "Dashboard": "Dashboard in Spanish".

Activity icon

Replied to Laravel Breeze Localization

@ahangarha That's simply the localization feature provided by Laravel. It has nothing to do with Breeze. In your case a translation string 'Dashboard' is used as the translation key.

https://laravel.com/docs/8.x/localization

Activity icon

Replied to How To Load View Part By Part In Laravel?

@sin2san Maybe you should use three different endpoints then, one for each datatable and trigger the loading of the 2nd and 3rd datatable after the AJAX request of the 1st has finished. That feels a bit dirty tho. Maybe it would be cleaner if you work with tabs/dropdowns/accordions on the same page. So the 2nd or 3rd datable is fetched if the user wants to look at it.

Activity icon

Replied to FreshDesk Integration In Laravel

@pavinder So you are saying you want to map Clients to Companies and Users to Contants? Don't you think that's going to be confusing? Especially for people using Freshdesk directly? Back to topic tho.

I would like to have a scheduled task that will synchronize the user in the app into the "Companies" in freshdesk.

Maybe it's better to work with model events there. Every time a new user is created, updated or deleted in your app you can synchronize Freshdesk. Same for new companies/clients.

https://laravel.com/docs/8.x/eloquent#events

Activity icon

Replied to How To Load View Part By Part In Laravel?

@sin2san What exactly are you trying to achieve? You want to load the 1st datatable, when that's finished the 2nd and after that the 3rd? How do they differ? Especially regarding the query parameters.

Activity icon

Replied to FreshDesk Integration In Laravel

@pavinder So basically you want to add and/or update contacts/users so that they belong to a certain company, right? How do you plan to achieve that? How do you associate a user/contact with a company? From Freshdesk's perspective it would be by simply adding a company_id to a contact.

Activity icon

Replied to FreshDesk Integration In Laravel

@pavinder Which endpoints to you want to integrate in your app? Maybe it's easier and faster if you simply use the API directly via Guzzle for example.

https://developers.freshdesk.com/api/

Apr
12
1 day ago
Activity icon

Replied to Help For Hack? On Forge/Digital Ocean

What are your folder permissions? Especially of the folder you found all the files in. Did you check the auth.log (usually inside /var/log/) if someone got access to your server except you? Since you already mentioned that you "logged in via ssh", I'd assume that's the only way to get access to your server?

Activity icon

Replied to Marking Selected Multiple Options With Select Blade Component

@jrdavidson Maybe I don't understand what you are trying to do, but why don't you simply check if the $value is inside selectedOptions?

public $selectedOptions;

// Rest of your component

public function isSelected($option)
{
    return in_array($option, $this->selectedOptions);
}

And ofc you can also check if old() contains that option prior to that if you want.

Activity icon

Replied to Livewire Selected Component - Passing Var

@randy_johnson I see. Okay, so if the button is clicked you want to emit an event with the selected ID to another component, right? The problem is that you don't set your $id variable anywhere. Since you want to emit the event when the button is clicked I would use wire:model.defer="id" on your <select> element and make the necessary changes to your component of course.

Activity icon

Replied to Livewire Selected Component - Passing Var

@randy_johnson Why don't you use wire:model.defer on your <select> input and why do you explicitly use $emit? I don't understand what you are trying to achieve in the first place.

Activity icon

Replied to Change Email Verification URL On Laravel Fortify

@ssquare You could define the createUrlCallback of the email verification notification (i.e. Illuminate\Auth\Notifications\VerifyEmail) inside your AuthServiceProvider and build the URL as needed.

// Inside your `boot()` function
VerifyEmail::createUrlCallback(function ($notifiable) {
    // Build and return your verification URL as needed
})

Basically the same as @neilstee suggested, just a level "deeper".

Activity icon

Awarded Best Reply on Request Header

@walker Have you tried defining your header as key/value pair?

Http::withHeaders([
    'Authorization' => 'Token *****',
])
Activity icon

Replied to Request Header

@walker Have you tried defining your header as key/value pair?

Http::withHeaders([
    'Authorization' => 'Token *****',
])
Activity icon

Replied to Integrity Constraint Violation: 1062 Duplicate Entry For Email

@anilkumarthakur60 https://laravel.com/docs/8.x/validation#rule-unique

Scroll down a bit to "Forcing A Unique Rule To Ignore A Given ID:"

By the way, there is a dedicated rule for password confirmation, don't have to do it manually:

https://laravel.com/docs/8.x/validation#rule-confirmed

Activity icon

Replied to Modal Is Not Scrollable

@anonymouse703 What part exactly do you want to be scrollable? The content of the tabs or the modal body in general? Either way you could simply set a max-height for your div and work with overflow-y: auto.

For example:

<div class=" modal-body" style="max-height: 400px; overflow-y: auto;">
...
</div>
Apr
10
3 days ago
Activity icon

Replied to Laravel Array If Condition With Another Variable

@obink What exactly is in your $quantities and I'd assume the stock column of your products table is an integer?

Apr
09
4 days ago
Activity icon

Replied to Undefined Array Key 0

@ajvanho

Undefined array key 0

Wondering what the problem could be...

Apr
08
5 days ago
Activity icon

Replied to How Can The Track Any Email By Open Or Read

@pro_raheel What do you mean? It works for all major mail providers (gmail, yahoo, ...). If the recipient email doesn't exist it logs "bounced" and/or "failed" events.

Activity icon

Replied to How Can The Track Any Email By Open Or Read

@pro_raheel

We are using mailgun service for send email in Laravel, We have seen option of tracking email but not sure this tracking will be work after purchase the Plan.

It does. For the "opened" event to work you have to enable it in the control panel and configure the CNAME record tho.

https://documentation.mailgun.com/en/latest/quickstart-events.html#events

Mar
31
1 week ago
Activity icon

Replied to How To Assert After A Job Queue Is Pushed?

@chaudigv You probably want to (unit) test whatever your job is doing and test that your job is being dispatched. Everything in between is already tested in the framework itself.

Activity icon

Replied to Best-practice For 3-layered Database Model

@axtg

Now if all become belongToMany (which I think you're right), then the hasManyThrough becomes challenging or?

That's true, but you could still eager-load them using with for example.

And on point 3, I think boolean should be OK. Are you thinking pivot?

Yes, but maybe I didn't understand what exactly you are trying to do. Is it just about liking/disliking a single product, feature or spec or about liking/disliking a combination of a product, feature and/or spec?

Activity icon

Replied to Best-practice For 3-layered Database Model

@axtg Regarding your relations:

  • Product - Feature: Should be many-to-many (belongsToMany on both sides), right?

  • Feature - Specs: same

  • Recommendations: Are your recommendations only going to be good or bad (true or false)? Or are you planning to add arbitrary recommendations in the future, like "Good with a sprinkle of lemon juice"?

Activity icon

Replied to Getting The Parent Calling Model

@camillele I wouldn't do that. What if you query payment types directly, what should the accessor do than? Or what if you add another relation in the future? Your description property is going to be dependent on so many "outside" factors. What exactly do you want to do with the description? Maybe it's wiser to add a new column to your payment_types table or you work with a subquery addSelect when eager loading the payment types on the user model.

Activity icon

Replied to Request Validation Max Length With Db Column Length

@vinayprajapati Thanks, but it wasn't my question. You should have notified @sairahcaz . I would probably just use a constant for that, either in the "articlese" model or in some config file. It's pretty unefficient imo if you have to fiddle around with the database in order to retrieve the length.

Activity icon

Replied to Best Editor To Add Content For Journal Website

@deekshith Should work using the "Link" plugin. I really like tinymce, but CKEditor is nice too.

Activity icon

Replied to Request Validation Max Length With Db Column Length

@michaloravec I believe he meant if it's somehow possible to fetch and use the varchar length of the table column inside the validation, instead of "hardcoding" it to 150.

Activity icon

Replied to Getting The Parent Calling Model

@camillele What do you mean exactly? You are going to have $user->subscription->paymentTypes and $user->charity->paymentTypes, so you already no where the payment types come from, no?

Mar
30
2 weeks ago
Activity icon

Awarded Best Reply on MySQL Says There Is Not Value, But There Is

@cservices Are they part of the $fillable array in your User model?

Mar
29
2 weeks ago
Activity icon

Awarded Best Reply on Subdomain Management On Forge

@mykelcodex Yes, as long as your DNS entry is set correctly and points the subdomain to the IP address of your forge server.

Mar
28
2 weeks ago
Activity icon

Awarded Best Reply on Where Do Socialite OAuth Tokens Get Stored?

@uptiie You can store them yourself, after the user has successfully authenticated and the auth callback is called by the provider.

https://laravel.com/docs/8.x/socialite#retrieving-user-details

Mar
27
2 weeks ago
Activity icon

Awarded Best Reply on Relationships

@wakanda

The question is how do i make sure that a user only rate a product once

Simply add a unique constraint to your reviews table for the combination of user_id and product_id, e.g.

$table->unique(['product_id', 'user_id']);

and if a user has reviewed a product how to i retrieve the user review for a specific product

You could use firstOrCreate for that:

$user->reviews()->firstOrCreate(
    ['product_id' => $productId],
    [...]
);

https://laravel.com/docs/8.x/migrations#indexes

https://laravel.com/docs/8.x/eloquent-relationships#the-create-method

https://laravel.com/docs/8.x/eloquent#upserts

Activity icon

Replied to MySQL Says There Is Not Value, But There Is

@cservices Are they part of the $fillable array in your User model?

Activity icon

Replied to Transaction With Multiple Model Inserts, Maximum Execution Time Exceed Error

@bhavil jain Why are you returning the response inside your database transaction? Move that code outside of the transaction.

Activity icon

Replied to Error 404 For Load Files

@mdelshad Did you create the storage link using php artisan storage:link and what's your default disk? putFile already returns the path, so you may want to reconsider your variable naming there.

Activity icon

Replied to Where Do Socialite OAuth Tokens Get Stored?

@uptiie You can store them yourself, after the user has successfully authenticated and the auth callback is called by the provider.

https://laravel.com/docs/8.x/socialite#retrieving-user-details

Mar
26
2 weeks ago
Activity icon

Awarded Best Reply on Modal Using Alpine.js To Auto Close And Reset On Add To Cart Click

@vapordev Why are you using x-init? Simply use x-on on your button and x-show on the modal:

// Parent defines "showModal: false" inside x-data
...
<button x-on:click="showModal = true; setTimeout(() => showModal = false, 2000)">
    Add to cart
</button>
...
// Modal
<div x-show.transition="showModal"">
    Added to cart!
</div>

Additionally you could clear previous timeouts, to avoid overlaps.

Activity icon

Replied to Get Selected Text From A Drop-down List

@coupdegraces I gave you all you need. Don't know what problem still remains. If it's your final project you should maybe try to solve it on your own. Would be highly beneficial for your future.

Activity icon

Replied to Subdomain Management On Forge

@mykelcodex Yes, as long as your DNS entry is set correctly and points the subdomain to the IP address of your forge server.

Activity icon

Replied to Subdomain Management On Forge

@mykelcodex Not really getting your problem. Simply add a site "api.example.com" to your server on forge and create the corresponding DNS entry on godaddy.

Activity icon

Replied to Get Selected Text From A Drop-down List

@coupdegraces As I said, you need to pass the "id" somehow...for example:

<select onchange="ddselect(this.value)"...
...
function ddselect(id) {
    // Your code
}
Activity icon

Replied to Modal Using Alpine.js To Auto Close And Reset On Add To Cart Click

@vapordev Why are you using x-init? Simply use x-on on your button and x-show on the modal:

// Parent defines "showModal: false" inside x-data
...
<button x-on:click="showModal = true; setTimeout(() => showModal = false, 2000)">
    Add to cart
</button>
...
// Modal
<div x-show.transition="showModal"">
    Added to cart!
</div>

Additionally you could clear previous timeouts, to avoid overlaps.

Activity icon

Replied to Get Selected Text From A Drop-down List

@coupdegraces Move the tipes const outside of your ddselect function, just inside the <script> tag.