shez1983

shez1983

Member Since 4 Years Ago

London

Experience Points
101,585
Total
Experience

3,415 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
227
Lessons
Completed
Best Reply Awards
101
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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 21
101,585 XP
Jan
16
1 week ago
Activity icon

Replied to How Do You Standardize Your JSON Responses?

laravel has its own API Resources..

Jan
10
2 weeks ago
Activity icon

Replied to Real Time Text Area , Any Idea ?

so how do the two users know when to finish and save? what are you trying to build

Activity icon

Replied to No Query Results For Model [App\Posts] Error

one other thing to note is that you are not deleting posts relating to Subcategories? but you are deleting them?

if you use Mysql Foreign key constraints they may do the work for you i think?

Activity icon

Replied to Eloquent 3 Table Query

how do u define most used? is there another table or something? also if you put your raw SQL it would help people better understand what u want.

Jan
05
2 weeks ago
Activity icon

Replied to Is There Any Helper To Create Past Tense Of Word In Laravel

i dont think it would require a whole dictionary - after all Laravel has plural/singular helpers

Jan
03
3 weeks ago
Activity icon

Replied to How Will I Load Just The Data Table?

is this some kind of JS Plugin you are using which you can give a URL to, to fetch some data or are you doing it yourself?

if plugin - then check their docs if yourself - then why are you doing two ajax calls to admin/users? surely your console.log(data) should be giving you the result? btw dont forget to pass CSRF Token i think delete request needs it

Activity icon

Replied to Stripe Checkout

its due to the FSA which has required stripe and other payment providers to provide better security

Dec
31
3 weeks ago
Activity icon

Replied to How Can I Implement User Wildcard Search Using *?

what does * mean? it means search everything doesnt it? so you remove the where clause altogether or am i missing something?

Dec
27
4 weeks ago
Activity icon

Replied to Eloquent Polymorphic Relationships Struggle

the way you have it looks like invoice needs to be polymorphic so you need

invoice_table: id, cust_id, cust_type, ......... cust_type is just RegularCustomer, or DifferentCustomer

Activity icon

Replied to Wondering Why Uploading Works In Php 7.3, But Not In Php 7.4 With Laravel 6

can you post the whole string of messages. also if you have whoops you can look at 'params' being passed from file to file and see which valuesare now booleans but were arrays before

Activity icon

Replied to Livewire Performance Issue

also livewire is not yet production ready so be CAUTIOUS very cautious indeed

Activity icon

Replied to Cache Table Deadlock

you probably need to give us more info i.e. webhook code

Activity icon

Replied to Best Practice For Passing Parameter To Create Method

I would create my own explicit routes in this case.

you could try do a create route first and then use your resource route and pass in except=> create(); if that makes sense

Activity icon

Replied to Connecting Two Tables With Integration Table

you jave two choices..

  1. go with polymorphic relation as suggested.
  2. go with two intermediate tables (many to many).

in BOTH cases both models would need two relations....

Product:

-> product() relation -> vendor() relation

actually if you are doing polymorphic unless you need them separately one relationship should work.. look here for more info: https://laravel.com/docs/5.7/eloquent-relationships#one-to-many-polymorphic-relations or https://laravel.com/docs/5.7/eloquent-relationships#many-to-many-polymorphic-relations

I am not sure if its a one to many or many to many...

Activity icon

Replied to Errors

if its stored in the session do you need to OUTPUT it to a form hidden field? people normally do one or the other.. you can access the session value in your controller.

Activity icon

Replied to Best Practice For Passing Parameter To Create Method

the more 'correct' way would be to do

/users/1/profile/1/telephone you can do a post to that.. but in this situation i normally just skip the /users/1 as you know the profile id.. so: POST to -> /profile/1/telephone

one thing i am confused with is in the past when i havr created a profile its been a 1 - 1 with user.. but of course i dont know your table schema/app func etc.. so ignore this q

Activity icon

Replied to Admin Acting As Common User

^ that should work. you would have a list of users in the admin section and need a link/icon that says impersonate that would 'link' to this controller..

the other thing is when you do a destroy, you should also destroy the session...

also note there's a session spelling mistake in destroy() so be careful when copying/pasting his code.

Activity icon

Replied to Laravel 5: Trying To Get Property Of Non-object

its because someone told you to change in blade ->users() to user() but they didnt realise the relationship was actually users().. so that created another problem for you..

generally you should use optional and check the link i mention... or make sure user_id is always set with a comment

Activity icon

Awarded Best Reply on Laravel 5: Trying To Get Property Of Non-object

it's got nothing to do with AUTH user..

and it looks like in your comment.php the RELATION Should be user() not users()..

if you have access to your DB through GUI/TERMINAL then please check if all comments have an associated user i.e. user_id column filled...

so i would change eturn $this->belongsTo('App\User');

to return $this->belongsTo('App\User')->->withDefault();

https://medium.com/@codebyjeff/laravel-5-5-optional-class-withdefault-and-attribute-defaults-a2e901dbad62

Activity icon

Replied to Variable Not Found In The Blade

you can do return view('detail', ['data_api' => $data, 'data_carousel' => $carousel']);

although i am not sure why you cant just pas $data and $carousel directly without renaming i.e.

return view('detail', compact('data', 'carousel));

Activity icon

Replied to Laravel 5: Trying To Get Property Of Non-object

it's got nothing to do with AUTH user..

and it looks like in your comment.php the RELATION Should be user() not users()..

if you have access to your DB through GUI/TERMINAL then please check if all comments have an associated user i.e. user_id column filled...

so i would change eturn $this->belongsTo('App\User');

to return $this->belongsTo('App\User')->->withDefault();

https://medium.com/@codebyjeff/laravel-5-5-optional-class-withdefault-and-attribute-defaults-a2e901dbad62

Dec
04
1 month ago
Activity icon

Replied to Redirecting To Intended Url

do you mean if i go directly to my account page and if i am logged out, i will be redirected to that page after i login? i thought laravel handled that automatically? if not then you may need to store that page after u get redirected to login and then after logging in check if that session var exists & go there.

Activity icon

Replied to Can't Get Lazy Collections To Work

what exactly are you doing that you need to fetch 100k records?

Dec
02
1 month ago
Activity icon

Replied to Downloading Episodes

you'll just have to wait a bit.. :( but the ones you downloaded should be enough to keep you going?

Dec
01
1 month ago
Activity icon

Awarded Best Reply on Linking To Views In Another Views

few ways..

i am sure the /test is a route in your routes file? so name it. and then use href ="{{ route('name') }}"

or you can use i believe url helper url("test")

the docs will help more: https://laravel.com/docs/6.x/urls

Activity icon

Replied to Linking To Views In Another Views

few ways..

i am sure the /test is a route in your routes file? so name it. and then use href ="{{ route('name') }}"

or you can use i believe url helper url("test")

the docs will help more: https://laravel.com/docs/6.x/urls

Nov
24
2 months ago
Activity icon

Replied to Unauthenticated Error When Multiple Users Login From Same Browser

@tinycoder the default logout link that laravel uses out of the box is a POST logout not a GET btw. something food for thought?

Activity icon

Replied to Reduce Code Duplication

i agree with bobby - i was going to say constructor isnt the best place.

one more thing thats very cool nowadays is MVVM pattern - you create a class that holds all data for a particular view..

Activity icon

Replied to Generate Slug Url For Existing Data ?

while you can create temp. routes. you can also

  1. do this straight in MySQL.. (on 2nd thoughts this will be hard as i just googled so not worth it)

  2. do it using TINKER (via ssh into server).

Activity icon

Replied to Maximum Execution Time Of 60 Seconds Exceeded

i dont think app debug influences the LOG.. you always get the whole log regardless of the env. app debug is for DISPLAYING the error on screen which is dangerous for prod env.

also i do not think this is a job (unless job is triggered by the website during the lifecycle of a request, e.g if i click on register, you would trigger the job straight away to send me an email) - and if you do something like this then dont. send the job to a QUEUE and run it in background (using cli/scheduler etc) - any jobs running in this way do not have a max execution time

Nov
23
2 months ago
Activity icon

Awarded Best Reply on How To Cache A Paginated Query

@sinnbeck that will not work...

you need to add to the key page you are on so

Cache::get('myAwesomeComments' . $request->get('page', 1), function...

page is laravels default get param it uses for pagination

otherwise no matter what you do (ie go to next page - you will get same results

Nov
21
2 months ago
Activity icon

Replied to Can't Get The Hidden Input Value With Laravel

@shockwave619 just do as is suggested - you can duplicate things one to show user and one to send it via the form.

also on the side note - you probably dont want to be sending a hidden value for price in any case - its a massive risk because people can change the value.. instead you already have the products stored in session somewhere? so u can re-calculate the price in the B/E

Nov
18
2 months ago
Activity icon

Replied to How To Cache A Paginated Query

@sinnbeck that will not work...

you need to add to the key page you are on so

Cache::get('myAwesomeComments' . $request->get('page', 1), function...

page is laravels default get param it uses for pagination

otherwise no matter what you do (ie go to next page - you will get same results

Nov
16
2 months ago
Activity icon

Replied to One Custom Request Class For Both Create And Update Action

i personally would keep things simple and not use data [] wrapper (but i take it its coming from API?)

in the FormRequest validation you can have something like:

$rules = ['name' => 'required']....

if request()->isMethod('patch') or if request()->has('data') 

// array_map and append 'data.' to each rule key.. 
Nov
12
2 months ago
Activity icon

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

i think your signature is wrong:

function show(Article $article , $id)

$article is already loaded if you have route model binding.. $id is superflous... if you dd ($article) you will see

Activity icon

Replied to Login Function Doesn't Validate

to answer your q.. its the else part where u need to do a header to go back to login form..

} else {
                    $password_error = "<p>Password is not correct!</p>";

you might want to get a hard hat - because people are really going to criticise your code.. this is to put it bluntly horrible... something from 90s.. or early 2000s..

Activity icon

Replied to Unlimited Number Of Optional Parameters In Route Uri

may i suggest using get params instead? url.com?param1=ddd&param2=ddd etc.. more cleaner - of course if its not needed as i dont know what u r doing stick with what u have but it can bite you in the backside as this route might be triggered for other scenarios..

Nov
11
2 months ago
Activity icon

Replied to Is It A Good Thing To Have Many Textarea ?

yeah thats clear - thats acceptable.

Activity icon

Replied to Searching For Hints/tips For Making Website Work On Smartphones.

why are you spamming this forum and bringing up dead posts? you are alienating people here

Activity icon

Replied to Check If Endpoint Exists

sometimes you need to make the endpoints for your android/ios guys.. if so then a mock response should be sent as that will show you and them what is needed.. ie great for planning

Activity icon

Replied to Is It A Good Thing To Have Many Textarea ?

from program wise i dont think its a problem - for humans to fill that many text areas (well i dont know how many you have) might be a detriment - esp if required, could make users leave your site.. (ie if used for registration)

Activity icon

Replied to Loop Inside A Loop. Continue At The Index+1 Where The Intern Loop Stop

yes you will have to but at the moment your F/E is doing unnecessaery work of filtering out. also you shouldnt be using DB:: thats what eloquent/relationship is there for (albeit they work for simplistic) even if you do it using JOIN etc it should still work.. for dates u just have to parse them as carbon instances first..

Nov
07
2 months ago
Activity icon

Replied to Factories With Closure

can you give an example of scope how it should look like? can you also tell us what this factory is doing now and any errors you may be getting? you can also do the json_encode when you return the scope instead of doing it outside (not sure if that would make much difference) can you also take the return [ ] of the Userfactory (not including return). and in tinker create an array and see what value scope has

Nov
06
2 months ago
Activity icon

Replied to Loop Inside A Loop. Continue At The Index+1 Where The Intern Loop Stop

i am not actually sure of what your answer is - but some of the logic can be done in controller or even in the sql query - you are getting all appointments and then checking if appoint not today.. similary the second if can also beommitted but i am not sure what it is doing..

Nov
05
2 months ago
Activity icon

Replied to Error: Unexpected '@endforeach' In Blade

you can also look at the compiled version of blade (which is pure php) sometimes to see what its doing..

Activity icon

Replied to Laracasts Improvements Discussion

@jlrdw its ironic you are questioning his programming experience ;)

Nov
04
2 months ago
Activity icon

Replied to Laracasts Improvements Discussion

i dont think anyone would sit here and 'mark complete' all videos to have a higher XP - it gives them no incentive/bonus/award or indeed even a pat in the back...

Nov
03
2 months ago
Activity icon

Replied to @guest @elseguest Part Not Working?

it doesnt matter what version i am using - i clearly gave u a snippet from the core with Else compiling function.. which means i should have access to elseauth elseguest

i am on 6.0 but that wont make a difference..

Activity icon

Replied to Laravel Illuminate\Support\Collection - FirstOrNew (and Similar) Possible With Extending? (Not Eloquent)

you can extend collections if that is what you are asking.. there are some instructions in the docs..

Nov
02
2 months ago
Activity icon

Replied to @guest @elseguest Part Not Working?

@nakov please see my first post again....