raphadko

raphadko

Member Since 3 Years Ago

Experience Points 945
Experience Level 1

4,055 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 1
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

01 Oct
2 years ago

raphadko left a reply on Microseconds With Laravel's Timestamp

any updated on this?

30 Aug
2 years ago

raphadko started a new conversation Cashier Event Once The Trial Is Over And Subscription Is Activated

I want to achieve something quite simple, but I'm having a hard time.

I want to send a message to users once their 5-day trial has ended, and is converted to an active subscription.

The problem is I can't find any of these events in Cashier documentation, and the stripe webhooks are automatically handled by Cashier.

How to deal with this?

03 Jun
2 years ago

raphadko left a reply on Same URL, Multiple Pages

The problem with the solution is that I can't attach different middleware with each view.

raphadko started a new conversation Same URL, Multiple Pages

I want to add a functionality on my web app where users visit the same URL and get different pages depending if they are logged in or not. The way I'm doing this now is using a middleware to redirect logged in users to /home. But, I want to do something like facebook does..

When someone types http://facebook.com, it analyzes if the person is logged in, if they are, it shows their home, if they are not, it shows the registration page on the same URL (you can see that the address in the bar does not change)

How can I achieve this on Laravel? Is there a way a middleware can reroute to a different controller method? Would that be the right way to do it?

02 Jun
2 years ago

raphadko started a new conversation Difference Between Redirect('/') And Redirect->guest('/')

What's the difference?

24 May
2 years ago

raphadko started a new conversation Laravel Cashier - How To Execute A Function When Subscription Is Over?

When an user subscription expire I need to automatically execute a function that will clear some data and disable premium features. How can I do that in Cashier?

17 Nov
3 years ago

raphadko left a reply on Cashier - How To Execute A Function Once, When Account Expires?

So I looked into Cashier's StripeGateway file, which has this function :

public function cancel($atPeriodEnd = true) { $customer = $this->getStripeCustomer();

if ($customer->subscription) {
    if ($atPeriodEnd) {
        $this->billable->setSubscriptionEndDate(
            Carbon::createFromTimestamp($this->getSubscriptionEndTimestamp($customer))
        );
    }

    $customer->cancelSubscription(['at_period_end' => $atPeriodEnd]);
}

if ($atPeriodEnd) {
    $this->billable->setStripeIsActive(false)->saveBillableInstance();
} else {
    $this->billable->setSubscriptionEndDate(Carbon::now());

    $this->billable->deactivateStripe()->saveBillableInstance();
}

} Now it appears that when the account is canceled, two functions run - cancelSubscription and deactivateStripe. I didn't find a documented way to run something on account expire, so I figured I might have to extend these methods and run it myself, but I'm a bit lost on how to do it.

16 Nov
3 years ago

raphadko started a new conversation Cashier - How To Execute A Function Once, When Account Expires?

I'm using Cashier on my application.

Cashier has a simple way of verifying if the user is subscribed:

$user->subscribed();

Cashier stores on the users table a field "stripe_active" to check if the user has an active subscription. Now, I'm trying to do something kinda simple, but didn't find in the documentation.

When the user subscription expires, I want to run a function that will disable some stuff on his account and save it to the database. I don't want to check and run it at every login , I want it to fire only once, when the account expires.

Stripe has a webhook that does that when payment fails. But I did not find one when the account expires. Can someone help out?

raphadko left a reply on Cashier Generating Multiple Customers With The Same Email

Ok, the error was that ajax was submitting the request to another route. After 2 days searching for this, I feel stupid. :(

15 Nov
3 years ago

raphadko left a reply on Cashier Generating Multiple Customers With The Same Email

Sure, from cashier's billable class:

public function updateCard($token)
{
    return $this->subscription()->updateCard($token);
}

And from Cashier's StripeGateway:

public function updateCard($token)
{
    $customer = $this->getStripeCustomer();

    $card = $customer->sources->create(['source' => $token]);

    $customer->default_source = $card->id;

    $customer->save();

    $this->billable
         ->setLastFourCardDigits($this->getLastFourCardDigits($this->getStripeCustomer()))
         ->saveBillableInstance();
}

raphadko left a reply on Cashier Generating Multiple Customers With The Same Email

Code is pretty simple, just a basic credit card update;

$user = \Auth::user();
$stripeToken = \Input::get('stripeToken');
$user->updateCard($stripeToken);
return 'ok';

raphadko left a reply on Cashier Generating Multiple Customers With The Same Email

This appears to be a coded bug in cashier. All my settings appear right.. Can anyone help?

14 Nov
3 years ago

raphadko started a new conversation Cashier Generating Multiple Customers With The Same Email

I'm using cashier for my subscription plans. Every time I change the user's card with $user->updateCard($stripeToken); a new customer is generated on Stripe, with a new card but same e-mail, when in reality it should just update a customer's card. What could I be doing wrong?

02 Oct
3 years ago

raphadko left a reply on Route To Redirect But Keep Other Variables

It's a route.. so, yes, it can be used with href. Button solution wouldn't work. :(

raphadko started a new conversation Route To Redirect But Keep Other Variables

Hey guys, I'm a bit new to laravel and I want to accomplish something I don know if possible..

I have a couple translation routes:

mydomain.com/pt -> sets cookie to portuguese language and redirects user to home (cookie will be checked in middleware and language will be set)

I want something that, from any page on my website, if the user gets the /pt in the url, the same would happen, but the url will be kept...

For example:

If the user visits mydomain.com/welcome - they will se a welcome page if they visit mydomain.com/pt/welcome - the '/pt' route will set the language and then redirect to welcome.. If they visit mydomain.com/pt/profile - the '/pt/ will do the same...

So basically, instead of just enabling /pt and redirect for the home screen, I want all the pages to have this option.

How could I accomplish this?

27 Sep
3 years ago

raphadko started a new conversation Does Laravel Queue Listener Really Need A Process Monitor?

From the documentation:

Note that once this task has started, it will continue to run until it is manually stopped. You may use a process monitor such as Supervisor to ensure that the queue listener does not stop running.

My question: So, the documentation explicitly says it will continue running until manually stopped. Since I don't plan to manually stop it, do I really need a process monitor to make sure it's running? Would I be ok just starting at every time the server starts up?

21 Sep
3 years ago

raphadko started a new conversation Laravel Validation - Check If A Column Exists

I'm using laravel's awesome validation classes, but I need to know if a column exists in the table (not a row in a given column, the column itself)

Is there a quick/easy way to check this without having to write a custom validation rule? If not, how could I write a validation rule for that?

Thanks

20 Sep
3 years ago

raphadko started a new conversation ThrottlesLogins Not Found After Upgrading To 5.1

I recently upgraded to 5.1 (yes I followed all the steps in the documentation)

But when I try to use ThrottlesLogins in my authcontroller, I get the message:

Trait 'Illuminate\Foundation\Auth\ThrottlesLogins' not found

I'm not sure what might be causing this, I am running 5.1.0.