ftiersch

ftiersch

Member Since 4 Years Ago

Experience Points
120,385
Total
Experience

4,615 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
101
Lessons
Completed
Best Reply Awards
175
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 25
120,385 XP
Apr
15
1 month ago
Activity icon

Replied to 10mb File Validation Problem

Probably it's running into a webserver limitation (either an nginx/apache setting or a php setting) that doesn't allow files larger than 10mb to be uploaded at all. So the validation doesn't get a file to validate basically.

Apr
13
1 month ago
Activity icon

Replied to Question About Application "State"

Part of that is correct, yes.

It will not automatically update component B but it will update the store. And if component B uses that store to get the client name it will automatically have the correct one too.

The store is supposed to be the single "source of truth". So what's in the store is reality and every component is supposed to tell the store "hey, I want to make change x!" so everyone knows whats up :)

"Reactive magic" is also something else though - the two way data binding. If you use v-model with an input field for example you can either type something in the input field and it changes the data variable in the component or you can change the data variable and it changes the value of the input field. That's also reactivity :)

Apr
12
1 month ago
Activity icon

Awarded Best Reply on Is It Possible To Rename The -pivot Attribute On A Model

Straight from the docs :)

return $this->belongsToMany('App\Podcast')
                ->as('subscription')
                ->withTimestamps();
Activity icon

Replied to Is It Possible To Rename The -pivot Attribute On A Model

Straight from the docs :)

return $this->belongsToMany('App\Podcast')
                ->as('subscription')
                ->withTimestamps();
Apr
08
1 month ago
Activity icon

Replied to Property [quantity] Does Not Exist On The Eloquent Builder Instance.

Instead of

$getCartQuantity->where('user_id', $user->id)->quantity->get();

Use

$getCartQuantity->where('user_id', $user->id)->first()->quantity;

But that will throw an error if there is no cart with that user ID, be mindful of that.

Apr
07
1 month ago
Activity icon

Awarded Best Reply on Move Variable To One Place

If you have data that a view needs every time (no matter where it is rendered from) then yes, that would call for a view composer :)

Activity icon

Replied to How To Make Variable For "@yield"

What do you mean by "call pages by name"? If I understand you correctly I think you're looking for @include, not @yield

@yield would change the name of the section the inheriting template needs to overwrite

Activity icon

Replied to Move Variable To One Place

If you have data that a view needs every time (no matter where it is rendered from) then yes, that would call for a view composer :)

Activity icon

Replied to Make:Resource Vs Make: Controller

The JSON is handled automatically but you can transform the data.

Quick example... Let's say you have a blogpost and sometimes you want only certain parts of the posts (title + shortened text for a list view for example) and on the details view you need the whole post.

You could have a ListBlogPostResource and a BlogPostResource to handle that transformation of data from the same BlogPost model. That way the transformation is always the same if you need to do it in multiple places (for example a search endpoint or something like that).

The endpoints are still handled by controllers though, that is correct :)

Activity icon

Replied to Send XML Body With HTTP Client (Laravel 7)

JSON and XML are both simply text. What the other side makes of the text depends on the header you send with it.

Just use the header "Content-Type" with "application/xml" (I think) and if the endpoint can handle XML it should be okay.

Activity icon

Replied to Make:Resource Vs Make: Controller

make:resource will create an API resource. Not the same thing as resource controllers!

API Resources are used to transform the responses of APIs in a uniform value, you still need a controller to return them.

Apr
06
1 month ago
Activity icon

Awarded Best Reply on Fetch A View Via Config File

Don't render the view inside of the config. Save the path to the view and then include it.

return [
	'views' => [
		'example' => 'test.example',
	]
];
@include(config('test.views.example'))

Something like that

Activity icon

Replied to Fetch A View Via Config File

Don't render the view inside of the config. Save the path to the view and then include it.

return [
	'views' => [
		'example' => 'test.example',
	]
];
@include(config('test.views.example'))

Something like that

Activity icon

Replied to Problem With Ressource

How and where are you using that resource? can you show the code in the controller (I presume)?

Apr
05
1 month ago
Activity icon

Replied to Static Functions In Controllers? What's The Alternative?

  1. If you need to call another method I'd say that sounds like you might need to think about restructuring some of your code
  2. Controllers are just objects. You can instantiate it and call it.
Apr
02
1 month ago
Activity icon

Replied to Page Expired

Well, now it works because you've basically turned off the CSRF middleware alltogether which causes the 419 error ;-)

Does it happen during the login? Or on a different request? Do sessions work in general?

Activity icon

Replied to Page Expired

What SESSION_DRIVER are you using in your .env file?

Apr
01
1 month ago
Activity icon

Awarded Best Reply on Gate::allows In Controller Constructor Laravel

Sounds to me like a Middleware would be appropriate here and then you can add a Route group with that middleware attached to it.

Mar
31
1 month ago
Activity icon

Replied to Gate::allows In Controller Constructor Laravel

Sounds to me like a Middleware would be appropriate here and then you can add a Route group with that middleware attached to it.

Mar
30
2 months ago
Activity icon

Awarded Best Reply on Workaround To Use {{asset('')}} In Lang File?

'hello' => "Hello at <img src='" . asset('/images/logo.jpg') . "'>"

Does this work?

Activity icon

Replied to Workaround To Use {{asset('')}} In Lang File?

'hello' => "Hello at <img src='" . asset('/images/logo.jpg') . "'>"

Does this work?

Mar
26
2 months ago
Activity icon

Awarded Best Reply on Error When Inserting Data

Either in your Role model or in your User model you have a relationship user() (or role()) with a belongsToMany. If your junction table is called different you can pass that name as a second parameter to belongsToMany.

Activity icon

Replied to Error When Inserting Data

Either in your Role model or in your User model you have a relationship user() (or role()) with a belongsToMany. If your junction table is called different you can pass that name as a second parameter to belongsToMany.

Mar
25
2 months ago
Activity icon

Replied to Using WhenLoaded In Resource Collection I Got Error

https://laravel.com/docs/5.8/eloquent-resources#conditional-attributes

Use "when" instead of "whenLoaded". whenLoaded checks if the given relationship was already loaded and then includes it.

Activity icon

Replied to Custom Validation Rule For Update

And where is the problem?

Mar
24
2 months ago
Activity icon

Replied to Asking For An Advise On Multiple Laravel Projects On A Single Server

How about setting up subdomains for each project and every subdomain points into the respective project folder?

like: http://project1.myserver.com points to /var/www/html/project1/public

And so on

Activity icon

Replied to Hide A Table Row On Delete

How do you delete it? If this.$el contains the whole table you need to find the correct row inside it.

But if you use VueJS you should use a data driven approach. So your table is rendered from a dataset (probably an array) and if you delete an element of that array it should automatically disappear from view.

Mar
23
2 months ago
Activity icon

Replied to Best Practice (and Steps) To Replicate A Laravel Project In A Second Dev Environment

That's correct. Migrate and possibly seed the database if you have data that needs to be preseeded.

Activity icon

Replied to Database: Pagination - Links() Not Working

No problem, instead of

$request->all()

use

$request->except('_token')

:)

Activity icon

Awarded Best Reply on Database: Pagination - Links() Not Working

{{ $dps->appends([$request->toarray()])->links() }}

You've added two array hierarchies here... "toArray" already returns an array so you don't need the brackets around it.

{{ $dps->appends($request->all())->links() }}

Does this work?

Activity icon

Replied to Database: Pagination - Links() Not Working

{{ $dps->appends([$request->toarray()])->links() }}

You've added two array hierarchies here... "toArray" already returns an array so you don't need the brackets around it.

{{ $dps->appends($request->all())->links() }}

Does this work?

Activity icon

Awarded Best Reply on Transform Collection To Query In Order To Use Paginate

You can group your result by the isbn :) Should have the same result.

Book::latest('year')->groupBy('isbn')->paginate()
Activity icon

Replied to Transform Collection To Query In Order To Use Paginate

You can group your result by the isbn :) Should have the same result.

Book::latest('year')->groupBy('isbn')->paginate()
Mar
21
2 months ago
Activity icon

Replied to Store Who Created_at & Who Updated_at ?

Same thing. Just give the column and relationship a different name. "user_updated_id" for example.

Mar
20
2 months ago
Activity icon

Replied to Call To A Member Function Verbose() On Integer

Well, it is clear...

Your "workflow" attribute is an integer, not an object like you expect it to be :)

So you need to find out where this attribute is set and why it is an integer and not an object.

Activity icon

Replied to Dynamically Dependent Drop-Down Lists Without AJAX & JQUERY

And you would reload the page every time someone changes the selection of the first drop down or what is your plan?

->whereRaw('categories.ProductID='.$data.'')

->where('categories.ProductID=' . $request->get('productid'))

Change the first one to the second one, that should at least get rid of your SQL error. But I think there is more wrong with that plan.

Activity icon

Replied to Dynamically Dependent Drop-Down Lists Without AJAX & JQUERY

->whereRaw('categories.ProductID='.$data.'')

where categories.ProductID={"ProductID":null})

I'm not sure what you are trying to accomplish here exactly?! But an Eloquent Model will automatically be converted to JSON if you force it to a string (which you are doing in that where) and the result is what you see in the error which is not MySQL

Mar
19
2 months ago
Activity icon

Replied to InvalidArgumentException: Unable To Locate Factory With Name [default] [Route].

Seems like you don't have a RouteFactory? :)

Mar
18
2 months ago
Activity icon

Replied to How To Pass Data From Blade To VUEjs Chart.js/Vue-Chartjs Components

Read up on "props" in vuejs :)

Basically you define a prop on your component and then you can fill it from "outside" like this:

<component :prop-name='@json($someData)'></component>
Activity icon

Awarded Best Reply on Send Notification When Update Event Occurs

if ($item->isDirty('status') && $item->status === 'Loaded') {

I think that should work

Activity icon

Replied to Send Notification When Update Event Occurs

if ($item->isDirty('status') && $item->status === 'Loaded') {

I think that should work

Activity icon

Replied to Send Notification When Update Event Occurs

$item->isDirty('status' === 'Loaded')

This line would check if "false" is dirty... 'status' === 'Loaded' is always false because it compares two strings.

Activity icon

Awarded Best Reply on Alternative To User::select('*')?

If you still want to save the query object you can use

User::query()

But as the other guys said - usually you don't need it :)

Activity icon

Replied to Alternative To User::select('*')?

If you still want to save the query object you can use

User::query()

But as the other guys said - usually you don't need it :)

Mar
12
2 months ago
Activity icon

Replied to Default Role For New Users

"hasRole" sounds to me like you check if the user "has a role"...

Have you read the documentation?

Says there the method is $user->assignRole('writer');

Activity icon

Replied to Validation

Reload your page and try again. If it still doesn't work your sessions aren't setup properly - that's why your CSRF doesn't work.

Mar
11
2 months ago
Activity icon

Replied to Trying To Do A SUM On A Collection Result From A GroupBy

Yeah as long as the pharmacy isn't run by a programmer I think what @jlrdw meant is that it looks like a bug in your code could easily lead to people taking the wrong / wrong amount of medication ;-)

$amount = $records->sum(function ($record) {
	return $record->prescriptions->sum(function ($prescription) {
		return $prescription->prescriptionPayment->amount;
	});
});

If I understand your structure correctly this might work.

Activity icon

Replied to Trying To Do A SUM On A Collection Result From A GroupBy

Use different variables...

$sum = $records->sum();

$groups = $records->groupBy('type');