shez1983

shez1983

Member Since 4 Years Ago

London

Experience Points
107,545
Total
Experience

2,455 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
110
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 22
107,545 XP
May
24
1 week ago
Activity icon

Awarded Best Reply on Laravel Saving Pages

we dont know what you are talking about? whats the problem..

if you are writing code and browser shows old version of page - then you can do php artisan view:clear i believe or manually delete view folder somewhere in storage/framework/cache.

Activity icon

Awarded Best Reply on Calling Routes Internally

you can call the controller method directly do that. are you using a special port locally when browsing via a browser ie 8080 or something?

Activity icon

Replied to What Is The Good Mobile Framework To Connect With Laravel Project

all mobile framework should be good to connect with laravel. its about using whats best for your usecase and your expertise

Activity icon

Replied to Laravel Saving Pages

we dont know what you are talking about? whats the problem..

if you are writing code and browser shows old version of page - then you can do php artisan view:clear i believe or manually delete view folder somewhere in storage/framework/cache.

Activity icon

Replied to Calling Routes Internally

you can call the controller method directly do that. are you using a special port locally when browsing via a browser ie 8080 or something?

May
15
2 weeks ago
Activity icon

Replied to I Can't Find The Problem In My Loop ! Help Please :(

i think you might need to create a console command that does this every minute and then checks how many lessons were created in that minute and show/send a notification

Activity icon

Replied to Laravel Boots Twice (?) For Each Requests

sorry even if i did - thats 3 years ago :(

Activity icon

Replied to How To Get Dates A Month From Now

@denniseilander answer is closer what you need to do is add another where

$month = Carbon::now()->addMonth(1)->month
$day = now()->addMonth()->day;

$data = DB::table('users')
->whereMonth('dob', '=', $month)
->whereDAY('dob', '=', $day)
->get();

Activity icon

Replied to Creating A Service Like Forge From Scratch

i think if we simplify it a bit to use AWS for example.. all i think forge does is talk to AWS API to get things done, like create a server, bring it up/down.. and perhaps have its own 'scripts' (for example when u create a fresh server it does all the things it needs to).. it might have its own database to link you as a user on its service to you as a user in AWS...

May
09
3 weeks ago
Activity icon

Replied to Images In Public Folder.

php artisan storage:link or similar.. i believe it does that for you.

you can also manually put folders inside public/images or w/e i dont think there should be a prob with that

Activity icon

Replied to Multiple Select Does Not Work On Edge

have u looked into the repo MDBootstrap maybe they have a warning/caveat of some sort.

Apr
30
1 month ago
Activity icon

Replied to How Do I Check If A Model Has A Job On The Queue?

nowadays in laravel there is a job chain method that runs jobs in sequence.. @flyingl123

Activity icon

Replied to Middleware Not Working

on a side note, you can use a map of sort and get rid of that switch so something like:

$map = [ 
	1 => 'pilgrim.dashboard',
];

if in_array($role, $map) // redirect 
else take to login or w/e

mind you your current switch takes an auth user back to login.. what is that user suppose to do at login if he doesnt have one of the roles u listed?

Activity icon

Replied to Laravel Passport: Use Different Model Rather Than User To Authenticate

in the auth.php config there is an api setting that you can change?

Activity icon

Replied to Is This A Proper Use Case Of Middleware?

your use case doesnt make much sense:

So what I was thinking of doing is redirecting a person to a sign up page if there are no existing users in the database. 

and what happens if one user signs up.. all the other users will then NOT be redirected to sign up page?

and there's no way of knowing if the current user is in the db or not (logged out version).. so i think if you need to just redirect people to sign up / login when they try to access a protected route..

Activity icon

Replied to GET Parameters From API Routes Not Getting Detected

check in RouteServiceProvider.. if using api.php route file, laravel already prepends it with api/ so you dont have to in api.php

Activity icon

Replied to Undefined Variable

$user how/where is it defined? u probably want the global auth()->user()->profile->... as i m guessing that user is part of the profile page..

you can fix this by followin this: https://laravel.com/docs/7.x/views#passing-data-to-views

Apr
29
1 month ago
Activity icon

Awarded Best Reply on Stripe Checkout

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

Apr
28
1 month ago
Activity icon

Replied to BCC In Mailable Not Working?

my issue if you read the thread was posted just above my last reply @rgcinq

Apr
21
1 month ago
Activity icon

Replied to Make:controller Is Not Working In Laravel 6.0

your question has changed, please stick to one question.. do as what was suggested first...

Apr
15
1 month ago
Activity icon

Replied to @dataProvider Fails Running Test

and the test works if you repalce $kunnr with 10000 inside the get?

Activity icon

Replied to Is This Caching Overkill

when you say id is indexed you mean in mySQL? and when u say getters get an object do u mean object from mysql (like a row that is then converted to object then cached?)

i dont think its an overkill for some things that dont change too much.. even for those that do it still improves the performance...

Apr
13
1 month ago
Activity icon

Replied to Stop Adding Poor Quality Laravel Addons

the only gripe i have is that the support you get from laravel team is pretty piss poor.. & very un-customer friendly (and i am talking about their paid products, forge/vapor)... at least they could say 'Hi... have you.. rather than a sentence.... which doesnt help

Apr
09
1 month ago
Activity icon

Replied to Request Is Empty

can you spit out the actual HTML produced by doing inspect element? can you do php artisan route:list to get the route

Apr
05
1 month ago
Activity icon

Replied to What Happens To Fields Not Guarded But Also Not Specified As Fillable

you can also test it yourself to see what happens...

Apr
03
1 month ago
Activity icon

Replied to Add Created By & Updated By To Data

a better solution would be to do use a package: https://github.com/spatie/laravel-activitylog this will log all activities not just the 'last user'

Activity icon

Replied to Route Pattern "/vendor/{id}/{{id}}" Cannot Reference Variable Name "id" More Than Once.

can you give all route file? because the error is self explanatory but i cant figure out what you are trying to do

Activity icon

Replied to How Do I Loop This Array To Get The Item Product Id?

if you convert this to a collection by doing $c = collect($array);

i think you can then do $c->pluck('item.id');

Activity icon

Replied to Losing My Mind Trying To Come Up With A Viable Queueing Scheme

i would also save that data into your database ( i assume you are doing this already)

Apr
02
1 month ago
Activity icon

Replied to Problem Generating A Code

if you insert the data directly into external db it will create its own code itself.. if its an API it should hae methods.. i am unable to understand anything as i have no knowledge of what u r doing or even what u r hoping to achieve.

Activity icon

Replied to Problem Generating A Code

why do u need consec. nos? and is it because u need to send your data back to external database?

Apr
01
2 months ago
Activity icon

Replied to Problem Generating A Code

whats the second set of numbers? 00000008 = 7407437B517E0766

are you wanting to replicate HOW they are making their code?..

when you say external db, do you mean through api or by actually connecting to an external DB?

Activity icon

Replied to Pass Ip And User_id In Every Store Model

if its on EVERY SINGLE Model then you have two choices:

  1. create a baseMODEL and extend every model from it. in this base model do:
	{
		static::saving(function ($model) {
	           // do whatever you need to
        });
	}
  1. use a bootable trait: more info here: https://andy-carter.com/blog/using-laravel-s-eloquent-traits (scroll down a bit).. and then use this trait in models that needs it..
Mar
31
2 months ago
Activity icon

Replied to Undefined Variable:totalPrice

that wont work either.. you are doing:

  <?php
                                        $totalPrice = 0;
                                        $totalPrice = $totalPrice + $item->product->price;
                                        ?>

so in each loop price = 0... so at best ur total price will be of ONE item.. and total price isnt working because its LOCAL to the foreach loop previously.. what you need to do is put $totalPrice = 0; outside and then it will be accessible by that part.

it is all to do with scopes.. you can use google to read about this concept. BTW i would have an accessor method on the order and calculate order price in there and call that method in here instead of doing it like you have

Activity icon

Replied to Php Artisan Migrate:refresh Error

can you post the code to admin_settings migrations, and a screen shot of all your migrations, i dont see why its trying to do select statement?

also if this is in your local server, then create a fresh database in sql, and change your .env to point to that and run php artisan migrate just to be sure

Activity icon

Replied to Reset Password Manually Via Answering The Security Questions Without Sending Email - Laravel/auth

you will probably need to ask them these q during registration and store them just like you would a password.. and then ask these if they forgot their password... (i think it might be easier to create your own login/register functionality but you can also override the controller functions)

Activity icon

Started a new Conversation Matching System - Need Pointers?

if i am creating a match system.. so if i like a user, and they like me back its a match.. then we can chat and if we like each other then propose some dates we can swap houses (its a home swap system not dating :p) how would i do it?

currently i have a likes table.. so if i like you, i will check if you have liked me before and then perhaps create a match/proposal table (status = initial).. which will link to chat table..

after either of us propose some dates i turn it into pending.. the other user can then accept/reject/propose new dates..

if accepted.. i then have to get people to pay.. (invoices, with one row for each person?)

proposal table = id, recipient_id, 'sender_id', status, start_date, end_date, guests

Mar
30
2 months ago
Activity icon

Replied to Laravel - Take 20 Rows Of The Latest Posts And Then Order By Column2

could you not sort by both, probably need to test it out but you could do latest()->latest('views').. so your query will have order by created_at asc, views desc or w/e.. might work.. (will save some php processing time if it works)

Activity icon

Replied to Queue Worker Stops Processing Jobs

@amosmos maybe you should also add the retry flag so your worker doesnt process a failing job more than x times..

Activity icon

Replied to Factory & Seeder For Pivot Table

have you read the docs? read all of the docs.. have you actually GOT a model? whats it called?

and if you are doing a pivot table, you DONT necessarily HAVE a model. when you do fake seeds, you need to seed the two tables (for example, category & news) separately.. and then have a seeder for Pivot table where you simply randomly connect the two.. using rand()..

for loop here

$c = Category::random()->first();  
$n = News::random()->first();

$c->news()->sync($n); 

// or do it directly in DB

DB::insert('insert into pivot table....');

Activity icon

Replied to Difference Between Queries?

you can always do a toSQL() to see the sql generated

Mar
29
2 months ago
Activity icon

Replied to How Make Global Variable To Reactive From Laravel To Vue Router

when i say set it, you can use local storage/cookies...

Activity icon

Replied to Laravel 6 + Apache = Takes Almost All Memory

provide your code no one is psychic here ;)

as a general rule:

  1. re-write your code to be more performant (look at generators for example)
  2. do the calculations in the background (using Queues/Jobs). CLI has more limits and you can do this logic ahead of time depending on its usage
  3. use SQL query to do the job you want instead of php
  4. if SQL query will be too long/complicated you can use a sql view to create a simplified version and use that to query OR denormalise data..

@andrey29 just updated this post.

Activity icon

Replied to How Make Global Variable To Reactive From Laravel To Vue Router

why dont you set variables in that function, piece of code then.. you can get the user back from login or make another call perhaps.. and then set it

Activity icon

Replied to Laravel Nova License

yeah me neither but from experience you can have one copy running on one project (dev, local and live)..

Activity icon

Replied to How Make Global Variable To Reactive From Laravel To Vue Router

why do you think you need to refresh the page? have you tested this and it doesnt work?

Activity icon

Replied to How To Exit The Tinker Console?

there is no need to bring a 3 year old topic to repeat what everyone else has already said!

Activity icon

Replied to Socialite: Save User ID To Database?

i think you still need to link the fb/google_id with the user so defo have separate columns but use your internal ID..

Mar
28
2 months ago
Activity icon

Replied to Socialite: Save User ID To Database?

you can build it so that when they use google/fb and come back to your site, you redirect them to their profile page stating they must enter an email address..

Activity icon

Replied to Display Relation Belong To Many

when you refresh database, you are adding random data and sometimes it will put things in the pivot so it works sometimes it wont so it wont work..

if you added more dish, did you add them into the pivot table as well? if i were you i would open up the databse in sequel pro/phpmyAdmin etc.. and go to pivot table remove all the data and add 1 by 1 and each time check the results.. there's no reason why your code shouldnt work unless there is no data in pivot