Snapey

Member Since 4 Years Ago

Mansfield

at Novate / Microlise

Experience Points 1,325,465
Experience Level 50

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 1102
Lessons
Completed
Best Reply Awards 1883
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.

26 Jun
21 hours ago

Snapey left a reply on Invalid Argument Passed

implode takes an array and converts it into a string with a separator character

I cannot see any separator in your code

25 Jun
1 day ago

Snapey left a reply on ErrorException: Trying To Get Property 'id' Of Non-object.

You will have to post some code

Snapey left a reply on Help Me Refactor This Code Its A Bit Lengthy

Ah ok. So order in this context is like sequence not purchase order

Snapey left a reply on How To Pass Multiple Variables In WithErrors?

Validate all the data first, then split it for your requirements

Snapey left a reply on @foreach Loop Not Working? Laravel 5.8.24 (WAMP) W10

Either. Actually this should only really matter when creating foreign key constraints so it's probably a red herring

Going forward primary keys default to big integer so probably use that

Snapey left a reply on Reusing Called Accessor

But you only put the return value in a local variable

$activity = $this->activities()->select('created_at')->where('status', 6)->first();

Snapey left a reply on @foreach Loop Not Working? Laravel 5.8.24 (WAMP) W10

@wyatt44 the reverse relationship is not needed until you want to go from reply to thread

Snapey left a reply on @foreach Loop Not Working? Laravel 5.8.24 (WAMP) W10

id on threads table and thread_id on replies should be the same column type

All thread ids will be unique and your replies table should contain multiple replies with the same thread id

Identify one of these ids and use it in your route

Snapey left a reply on @foreach Loop Not Working? Laravel 5.8.24 (WAMP) W10

what does your replies migration look like?

also, be aware that since thisvideo was created, a migration will make the thread Id a biginteger

your thread_id in the replies migration should be the same

Snapey left a reply on Reusing Called Accessor

because you just ran a query. It does not know that its a relation

if you did load('activities') and activities is a relation (which it seems it is), then yes, Laravel would tuck this away as a loaded relation

Snapey left a reply on Eagerly Loaded Relation Not Present In View

why not just test if $flight->passengers is populated?

Snapey left a reply on How To Build Page Login Laravel

Why would you build it when there is a perfect solution there for you already

Snapey left a reply on Auth Deploy Question

Look in the translation files

resources/lang/en/password.php

change the 'user' translation to whatever you want. Not sure the behavior will give the game away, eg 'We will send password reset email to the address you specified' - but then still leaving them on the password reset page.

The thing you will notice about most of the authentication classes, they are just shells that include the desired functionality via traits. This means that you can follow the link to the trait (eg 'SendsPasswordResetEmails) and then replace any of the functions with your own versions in the ForgotPasswordController

Snapey left a reply on Get Data From 3 Tables With Relationship Laravel

I mocked up some tables, and models, then tested with the following;

    Order::select('product_types.type_name')
            ->selectRaw("sum(orders.total) as totalForType")
            ->join('products','orders.product_id','products.id')
            ->join('product_types', 'product_type_id','product_types.id')
            ->groupBy('type_name')
            ->get();

it produces

[
  {
    "type_name": "SERVICES",
    "totalForType": "1000"
  },
  {
    "type_name": "VEGETABLES",
    "totalForType": "1025"
  }
]

Any help?

Snapey left a reply on Self Referencing Many-To-Many Relationship

regarding using profile, it just seems you will always start out with User but then always have to load profile to get to followers

Snapey left a reply on Auth Deploy Question

if it solves your problem, please mark best answer

Snapey left a reply on Reusing Called Accessor

You can create a dedicated relationship and then load () it so that it's a true nested relationship.

This won't itself solve the problem, but you can then use the loaded () function to skip the query if already performed.

Or, more simply, create a variable on the model and use this

Eg

private $activityDate;

And stash your value there and check if populated before running your query

Snapey left a reply on Self Referencing Many-To-Many Relationship

Not sure where HasOne is being specified. Probably in your user model, but it should be hasOne

Also in your profile model followers should be belongsToMany

Puzzled why you are making followers and followed from profile model and not User model?

Snapey left a reply on How To Change Default Path Of File Storage

There is a configuration file for storage path

Snapey left a reply on Domain Name & Web Hosting Link

What, so your name and your providers name is the same?

Just looks like a spam question

Snapey left a reply on Auth Deploy Question

If you want to change the content of the email my blog post http://novate.co.uk/changing-the-laravel-5-3-password-reset-email-text/

You can also translate any of the strings in the email using translation files (including English to english)

Snapey left a reply on Auth Deploy Question

Please, never change any code in the vendor folder. This will not be committed to source control and will be overwritten by future updates

Snapey left a reply on Error Message When Trying To Register A User - "The Email Has Already Been Taken"

You are correct in that the unique rule prevents two users having the same name. Validation in Laravel is very robust so the only conclusion is that you do indeed already have a user record in the database with this email

Snapey left a reply on Self Referencing Many-To-Many Relationship

So if you turn off the check you get a 500 error? You need to find out what that is, by changin the error handling in your test or reviewing the log file

24 Jun
2 days ago

Snapey left a reply on Why Does Laravel Notifications Table Use UUID Instead Of ID?

Not sure why. Perhaps as an easy way to stop browsing all notifications?

Snapey left a reply on Email Verification Problem

In the past I have used email verification examples that predate the Laravel feature

Eg https://www.google.com/amp/s/www.5balloons.info/user-email-verification-and-account-activation-in-laravel-5-5/amp/

However recent projects have been password-less which requires email round trip to login anyway

Snapey left a reply on Separate Roles/permissions For Users Belonging To Multiple Organizations

As @tray2 suggests you can add an organization column to the roles and then implement a global scope to automatically hide roles for different organizations

Snapey left a reply on Route Error Forbidden

use your network tools in the browser. when you press the submit button, is a GET request sent? (It should be)

Snapey left a reply on Trying To Get Property 'title' Of Non-object

you did not show the Thread model and the morphsMany relationship?

Snapey left a reply on Salihawa

what command are you typing to add the path?

Snapey left a reply on Get Data From 3 Tables With Relationship Laravel

look. make sure there are no duplicated column names and then run the query again, and dump the results.

I cannot see any reason why your product type name would not show other than duplicate column name.

Snapey left a reply on Change App Default Locale Dynamically

isn't the config read into memory during Bootstrap?

Do you need to change the config values in memory?

Snapey left a reply on Get Data From 3 Tables With Relationship Laravel

but you wrote

and the product_type table have columns

id
product_type (this is the product_type_name)

Snapey left a reply on Get Data From 3 Tables With Relationship Laravel

if you use join then the collection cannot contain two columns with the same name

In these cases, you must use select() and then give columns aliases

Snapey left a reply on Develop On Windows 10, But Not When Offline

posted at the weekend, bumped for the work week crowd

Snapey left a reply on Making My Class Instance Persistent Over Next Request

php destroys everything after each request cycle and boots the whole framework again on the next request.

Only the user's session persists between requests

Snapey left a reply on Get Data From 3 Tables With Relationship Laravel

ok, so this is different to the very first posting.

you have two tables in the join with the same column name - only one can be present in the collection

Snapey left a reply on Bug When I Manually Login Users

ha. @munazzil ... so according to your snippet you have to be logged in to access the login page !

Snapey left a reply on Email Verification Problem

Every other site I have been to that requires email validation does it without being logged in.

Laravel implementation is certainly unusual, and not one I have been able to use myself because the user is automatically logged in.

There is no real reason why this should be any different from password recovery flow, and that does not require the user to be logged in (obviously)

Snapey left a reply on Salihawa

because your folder is your name and includes a space, you must use quotes around any path

What command are you Typing?

Is there anyway you can change your user folder to not include a space?

Snapey left a reply on Bug When I Manually Login Users

you can fill in the redirectTo property with a fixed place to redirect after login.

Creating a function in your LoginController called redirectTo() allows a string to returned dynamically, for instance if you want to redirect the user based on some condition or role.

But both of these are irrelevant if you don't use the standard code.

By the way, redirectTo (of either form) are not used if you use intended(). The intended function checks if the user was trying to access a protected page when the auth middleware intercepted their request. After logging in, the user is sent to the page they were going to originally.

Snapey left a reply on After Upload File, It Is Returning A Value Of Uploads/d87478f7c4717c356353a760fab9addc.jpeg But There Is No File There?

The docs containing working example. Share your code if you need help.

As to other examples, there are countless tutorials for this and all have their own way of doing this very common task

23 Jun
3 days ago

Snapey left a reply on Unknown Database Laravel 5.8 New Registration Of User

ok, so that all looks ok

My only thoughts are a) you are loading webpage from a different site, or b) you have installed a package that uses the database, but not yet configured it.

Snapey left a reply on Laravel 5.7 , Where Clause With Multiple Values

switch your if($request->driverid) for if($request->has('driverid')). and the same for routeId