Director at Novate Ltd

Member Since 6 Years Ago

Mansfield

Experience Points
2,230,075
Total
Experience

0 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
1444
Lessons
Completed
Best Reply Awards
3127
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 50
2,230,075 XP
Jun
13
1 hour ago
Activity icon

Awarded Best Reply on Trying Pass Query From Repository Or Model To Controller

with eloquent it's easier to create a relationship, but if I wanted to do this with a join then I would probably use a scope

public function scopeJoinBrand(Builder $query, $id)
{ 
    $query->join('brands', 'complains.brand_id', '=', 'brands.id')->where('id',$id);
}

then you can call it like

Model:: joinBrand($id)->get;

(watch your code style, conventionally, functions should start with lowercase)

Jun
12
1 day ago
Activity icon

Replied to How To Add Extra Column To Session Table And How To Store Data In It?

only records in the session table that are newer than the applications session duration are possibly on line

so records older than two hours (default) you can assume they have gone away

Activity icon

Awarded Best Reply on Laravel Csrf

csrf is for POST PUT and PATCH routes

Activity icon

Replied to Laravel Csrf

csrf is for POST PUT and PATCH routes

Activity icon

Replied to Not Getting Logged In User In Api Controller

If you don't want to use passport or JWT and just send request from Vuejs from the logged in user's session, then you should move the route to web.php

API routes are STATELESS. There is no concept of an authenticated user

Activity icon

Replied to Model Observers Vs. Gates

You would not really be expecting to throw exceptions in the model observer.

Observers are for side effects of modifying a model.

Nothing stops you from writing the complete application inside a model observer - but only an idiot would do that

Activity icon

Replied to Uninitialized String Offset: 600

its the same image at every resolution so what does it matter ¯_(ツ)_/¯

Activity icon

Replied to Image Source Not Readable

The make function requires the FULL PATH, including the filename.

Not this;

$img = Image::make($img);

more like this;

$img = Image::make($img . '/' . $filename);

but you need to check your path and filename and file extension to make sure you are providing the full server path to the image

Activity icon

Replied to Image Source Not Readable

give it the path AND the filename ....

Activity icon

Replied to Pagination

interesting read, https://simonkollross.de/posts/implementing-cursor-based-pagination-in-laravel

But why the $limit + 1? That's a little trick to find out if there is another page of results available. We fetch one row more than required, which is later removed from the results. So we know we have to create another cursor, because there is at least one more result available that lives on the next page.

Activity icon

Replied to Image Source Not Readable

you are trying to make intervention image from just the path

Activity icon

Replied to Image Source Not Readable

in line......

Activity icon

Replied to Image Source Not Readable

What problem?

by the way. you have a return statement inside your foreach loop so it will only ever execute one loop

Activity icon

Replied to Get A Relationship With Count When Using SetRelations Helpers

no, no more queries, you are simply counting the collection, in each place you need it

note reviews not reviews()

But your ideas need improvement. See @michaloravec answer for ideas, but this;

$product = Product::findOrFail($id)->withCount('reviews')->with('reviews', 'photos', 'attributes'); 

is all wrong, the find should be the last thing. after you have prepared the query

Activity icon

Replied to Slide Animation

forget flash, it's not supported anywhere.

what on earth would be the point of a video that just showed slides?

use a good carousel with css transitions

Activity icon

Replied to Get A Relationship With Count When Using SetRelations Helpers

what does that mean? saturating ?

Activity icon

Replied to Get Name Of First Invalid Input Field For Autofocus

the error bag is just a collection, you should be able to get the first() entry, but this will might give you the 1st in your validation rules not the first on the page?

But what I would investigate is setting an extra property in the error bag once you have autofocus your first error so that subsequent instances of your component on the page know not to autofocus

Activity icon

Awarded Best Reply on Livewire Image Upload Filename

$filename = $this->photo->store('photos');
Activity icon

Awarded Best Reply on Pass Input Field Name To Anonymous Component

1st problem should just be

<x-input-error field="name" />
Jun
11
2 days ago
Activity icon

Replied to Cursor Pagination On Eloquent Models

does it work with regular pagination?

Activity icon

Replied to Livewire Image Upload Filename

$filename = $this->photo->store('photos');
Activity icon

Replied to Cursor Pagination On Eloquent Models

the cursorPaginate method will determine the position from the request. Do you have anything else going off with route parameters?

Activity icon

Replied to When User DB::transaction Cant Return Object

don't do anything inside the transaction other than the DB work

Activity icon

Replied to Can't Get Smtp Working With Postmarkapp

glad you got it working, but note that I frequently use postmark and have never used anything other than the built in smtp driver

The api route might be quicker but it's never an issue

Activity icon

Replied to Get A Relationship With Count When Using SetRelations Helpers

if you are loading reviews anyway, just count the collection

$product->reviews->count()
Activity icon

Replied to Refresh A Job In Livewire

poll is not going to cause your updatedUnit function to be called

Activity icon

Replied to Pass Input Field Name To Anonymous Component

1st problem should just be

<x-input-error field="name" />
Activity icon

Replied to Textarea Component - Getting The Text To Display - Jetstream Modal

should work the way you have it

what does the generated html look like? ( view source in the browser)

Activity icon

Replied to Redirect After Email Verification

what front end scaffolding have you used?

Activity icon

Awarded Best Reply on Is It Safe To Use .htaccess In Shared Hosting?

better option is to delete the public_html folder and then create a symlink called public_html and point it to the laravel public folder.

Activity icon

Replied to Livewire Image Upload Problem

dd in the function to make sure its called

look in the photos folder of the default disk for a randomly named file

Activity icon

Replied to How To Add Extra Column To Session Table And How To Store Data In It?

look in the sessions table to see who has active sessions

for each active user look in their user model for their office

Jun
10
3 days ago
Activity icon

Replied to Trying To Get Property 'txtemail' Of Non-object

You don't need the whole doctor object? Just use the email address just entered

Mail::to($data['email'])->send(new WelcomeMail());
Activity icon

Replied to Email Unique Ignore UserId Validation Rule Fails On Update

in your implementation, its ignored

Activity icon

Awarded Best Reply on Getting The Input Value Within Blade Input Field ?

Your not trying to tell me that you have 55,000 velos in the view at once?

Anyway, you could wire:model it using array syntax and having an array in the component

Or, create a component that is just for one velo and pass the ID into the component so it knows which velo it is responsible for

Activity icon

Replied to Getting The Input Value Within Blade Input Field ?

Your not trying to tell me that you have 55,000 velos in the view at once?

Anyway, you could wire:model it using array syntax and having an array in the component

Or, create a component that is just for one velo and pass the ID into the component so it knows which velo it is responsible for

Activity icon

Replied to Getting The Input Value Within Blade Input Field ?

wire not use wire:model?

Activity icon

Replied to Laravel7 Not Log Out Old Username On Sharedhost.

remember me?

do you prevent logged in user from getting to the login page?

Activity icon

Replied to A Very Unusual Case With If Check In My Controller

your browser might prefetch the link, so never perform actions that cause a change in the backend with a simple get request

Jun
09
4 days ago
Activity icon

Replied to Can't Get Smtp Working With Postmarkapp

you are using smtp not the postmark api ? Aren't you?

Activity icon

Replied to Livewire Image Upload Problem

after your code runs I would expect to see the image still in the temp folder but also in the images folder on the default disk

Activity icon

Replied to How To Add Extra Column To Session Table And How To Store Data In It?

personally i would save the office and the login time back to the user model

or just create a logins table and model

Activity icon

Replied to Can't Get Smtp Working With Postmarkapp

thats strange because your config is null for TLS

'encryption' => env('MAIL_ENCRYPTION', 'tls'),

and .env

MAIL_ENCRYPTION=NULL

have you cleared config cache?

btw. I use postmark and use TLS=null

Activity icon

Replied to Can't Get Smtp Working With Postmarkapp

use mail driver smtp ?

Activity icon

Replied to Site Also Accessible From /public

why not just create a symlink from public_html to public

I have done this multiple times on cpanel and it always works.

Activity icon

Replied to How To Use Several Identical Components

You have this line

$this->selectedServices = new Collection();

creates an empty collection, and then a couple of lines down

$this->selectedServices->forget($position);

where $position comes from the view and could be 0,1,2 etc

Activity icon

Replied to Artisan Trying To Run Scheduled Tasks Without Migrated Database

All commands are newed up on every artisan command. Definitely something in one of the constructors.

Jun
08
5 days ago
Activity icon

Replied to Relating A Model Twice?

that's why i asked the question

Community Pillar

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