timtom

timtom

Member Since 1 Year Ago

Experience Points
1,620
Total
Experience

3,380 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
0
Lessons
Completed
Best Reply Awards
1
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.

Level 1
1,620 XP
Aug
14
1 month ago
Activity icon

Started a new Conversation Schedule Run Two Times

Hello,

I would like to know if something can be done to prevent the two times running of schedule ? For example, if a schedule run every 10mn but take more than 10mn the be executed, a new one will be executed ...

Thanks in advance

Aug
10
1 month ago
Activity icon

Awarded Best Reply on 419 Page Expired

Ok the solution is to set the 'same_site' to null. (Not to 'none')

Activity icon

Replied to 419 Page Expired

Ok the solution is to set the 'same_site' to null. (Not to 'none')

Activity icon

Replied to 419 Page Expired

Ok i found the reason but i still have a problem.

It is because i set 'same_site' parameter to 'none' in session.php config file. I need to set it to same_site because i got problems with redirection from another website (Session was lost when i was redirected from external website).

Someone have an idea ?

Activity icon

Replied to 419 Page Expired

In incognito mode, i got 419 too ...

Activity icon

Replied to 419 Page Expired

Thanks for reply but it is not working and i sent @csrf and can see in post _token param

Activity icon

Started a new Conversation 419 Page Expired

Hello,

I got a problem with my Laravel app. I don't know why, but when i submit my login form with @csrf token, i see the page '419 Page Expired' ...

Someone already have this problem ?

Thanks

Aug
05
1 month ago
Activity icon

Awarded Best Reply on Update Return False

As i said, it is because i update something whith no change, and laravel return false... i just put a updated_at date, and now i get TRUE.

Activity icon

Replied to Update Return False

As i said, it is because i update something whith no change, and laravel return false... i just put a updated_at date, and now i get TRUE.

Activity icon

Replied to Update Return False

And it is on 7 version. Thanks talinon!

Activity icon

Replied to Update Return False

I know why, because eloquent return false when nothing change....

Activity icon

Replied to Update Return False

I do not go in catch...

Activity icon

Replied to Update Return False

It is just a simple ->update() with eloquent. This function return a boolean, when it return false, we do not know why it failed

Activity icon

Started a new Conversation Update Return False

Hello,

I try to do an update request but the request return false. Do you know if something exist to see the error in details (and not just get false in return ...) ?

Thanks

Aug
02
1 month ago
Activity icon

Started a new Conversation Set Expiration With Laravel Passport

Hello,

I use Laravel passport but when i create token for user, it never expired. Do you know how to set an expiration date ?

I create token like this :

$user->createToken("StrongAuth", [$user->scope])->accessToken;

Someone already have this problem ?

Thanks

Jul
30
1 month ago
Activity icon

Started a new Conversation Get The Maximum Number Of Relationship Of Collection

Hello,

I have a question, i got a collection by ->get() eloquent query. I need to know the maximum of relationship possible for elements in my collection.

I have multiples invoices, and i would like to know the maximum of payments done for one invoices.

I think a solution by doing map function and parse raw by raw and take the count of relationship each time and keep the maximum, but i think this is not really optimized.

Do you have an idea ?

Activity icon

Started a new Conversation Undefined Property: HasMany::$id

Hello,

I got a problem with foreign relations and eloquent, i would like to retrieve id from this :

$invoice->payments()->latest('date')->first()->id

And i got this error :

ErrorException: Undefined property: Illuminate\Database\Eloquent\Relations\HasMany::$id

It is strange because this is working for example : $invoice->payments()->sum('amount')

Someone already got this error ?

Jul
29
1 month ago
Activity icon

Replied to Dynamic Foreign Relationship

Thanks for reply,

I think about that but got error with $key = 'payments()->sum('amount')':

ErrorException: Trying to get property 'sum('amount')' of non-object

Activity icon

Replied to Dynamic Foreign Relationship

Thanks, but the part '->name' need to be dynamic too. And i will need to do something like this :

$key = 'payments()->sum('amount')'

Activity icon

Replied to Dynamic Foreign Relationship

Because it will be dynamic, the part 'partner->name' can change. (It is an export system, and i define column dynamicly in array. With that, i can create multiple export easily)

Activity icon

Started a new Conversation Dynamic Foreign Relationship

Hello,

I have a problem, i would like to get data through variable content. Example :

$data = Model::find(1); $key = 'partner->name';

echo $data->$key;

But it is not working, someone already got this problem ?

Jul
22
2 months ago
Activity icon

Replied to How To Make Stripe Invoices Downloadable For My Users?

Create a Form Request (https://laravel.com/docs/7.x/validation#creating-form-requests) to check the invoiceId with the current logged user.

Jul
21
2 months ago
Activity icon

Replied to How To Make Stripe Invoices Downloadable For My Users?

How do you retrieve the invoiceId ?

Activity icon

Replied to How To Make Stripe Invoices Downloadable For My Users?

I will not show you the code but you have all your payments in your database, so you can juste create a route who display view with data of payment. (Like a receipt)

Activity icon

Replied to Get Count Of Rows In Laravel Eloquent Before Using Paginate

Thanks it is working, i use ->items() to retrieves items and total to get count.

Jul
20
2 months ago
Activity icon

Replied to How To Make Stripe Invoices Downloadable For My Users?

It's just that no one has developed this feature in the cashier :)

If you want to have custom receipts, I advise you to generate them yourself by a receipt view.

Activity icon

Started a new Conversation Get Count Of Rows In Laravel Eloquent Before Using Paginate

Hello,

I have a eloquent request with GroupBy and SelectRaw with joins table ... I would like to count the rows but when i do that i got the 'count' column in each row with the number of joined table rows ...

I think that i need to remove the 'selectRaw' and 'GroupBy' options from the query builder, but i would like to use the same query instance for the two requests.

I would like to do this but actualy it is not working :

$count = $query->count('settlements.id'); $data = $query->paginate($per_page, ['*'], 'page', $page);

Thanks for help

Jul
17
2 months ago
Activity icon

Started a new Conversation Foreach Index=>value Equivalent With Collection Map

Hello,

I know that i can use ->toArray() function of collection but i would like to know if an equivalent exist or not ?

Thanks

Activity icon

Started a new Conversation Binding An Interface To An Implementation

Hello,

I build an interface to an implementation like this :

App::bind('UserRepositoryInterface', 'DbUserRepository');

And it is working when i use this in controller :

public function __construct(UserRepositoryInterface $repository)

But i would like to use the same solution in another class with his construct method but i got error if i don't give the parameter when the class is init with :

$class = new ClassName();

Someone already got this problem ?

Thanks

Jul
16
2 months ago
Activity icon

Started a new Conversation Select Last Column Value In Join Table

Hi,

Do you know how to select the last column value on a joined column with eloquent. I do somehting like that but i get the first column value :

->selectRaw( 'settlements.*, partners.name as partner_name, SUM(payments.amount) as total_paid, payments.date as last_date_paid, IF(SUM(payments.amount) >= settlements.amount, 1, 0) as is_paid' )

I got 3 payments in payments table (one line per payment), and i would like to select the most recent date.

Thanks in advance

Jul
14
2 months ago
Activity icon

Started a new Conversation Yajra DATATABLE FilterColumn Not Working

Hello,

I got a problem with the filterColmun of the package Yajra datatables. I use 'addColumn' and after 'filterColumn' but it is not working, the filter does not work, all the raw is returned.

This is my code :

            DataTables::eloquent(
                $this->settlementRepository->query()
            )->addColumn('is_paid', function($settlement) {
                return ($settlement->payments()->sum('amount') >= $settlement->amount) ? 1 : 0;
            })->addColumn('total_paid', function($settlement) {
                return $settlement->payments()->sum('amount');
            })->addColumn('partner_name', function($settlement) {
                return $settlement->partner->name;
            })->filterColumn('is_paid', function ($query) {
                $query->where('is_paid', '=', 1);
            }),
                	

In the returned data i can see one raw with is_paid at 1 and one other with is_paid at 0.

Thanks

Jul
02
2 months ago
Activity icon

Started a new Conversation Laravel Passport, Force Generation Token

Hello everybody,

I got a problem with my authentication system. I have two factor authentication for the login of my web application, so i need to generate and return the oauth token only when the strong authentication is validated.

I read the documentation of passport but i do not see anything about the manualy token generation...

Someone already had this problem ?

Thanks in advance