Snapey

at Novate / Microlise

Member Since 5 Years Ago

Mansfield

Experience Points
1,493,725
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
1182
Lessons
Completed
Best Reply Awards
2115
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 50
1,493,725 XP
Oct
22
4 hours ago
Activity icon

Replied to Eloquent "select, Where" Query?

@awaisirfan create your own question. This one is over 3 years old!

Activity icon

Replied to Using Another Method Of Same Controller Inside One Method Causing Error

but its working fine except that it doesnt work

Activity icon

Awarded Best Reply on "Responsive" Email Templates

perhaps read https://www.smashingmagazine.com/2017/01/introduction-building-sending-html-email-for-web-developers/

but yes, html email is primitive and still largely relies on table based layout, inline styles and standard fonts.

Activity icon

Replied to RelationShip Access Help

Eloquent way

$user  = 10;

$categories = Category::whereHas('posts', function($query) use($user) {
                          $query->where('user_id', $user);
                        })->get();

returns all categories having posts by specific user

Activity icon

Replied to Can't Access An Uploaded File (404)

Is your site hosted properly so that the index.php is at the root and not in some sub-folder.

ie, do you see public in your URLs ?

Activity icon

Replied to Using Another Method Of Same Controller Inside One Method Causing Error

You are missing the point from the Stack Overflow question. There the function calls itself to iterate over the other arrays.

Practice with the example there until you understand what it is doing. Recursion can be mind bending but powerful.

Oct
21
1 day ago
Activity icon

Replied to Using FirstWhere And Update Other Duplicats

first in the collection when you order it how?

Activity icon

Replied to Ssl Website

My Laravel apps know nothing about if they are http or https. This is handled by the webserver.

Your answer depends on how you host the site. If you have a dedicated server you can install lets encrypt and get free certificates. If you are on shared hosting then you are restricted to what your hosting provider can do.

Activity icon

Replied to RelationShip Access Help

just the distinct categories, or the categories of each post (nested in post)?

Activity icon

Replied to View Models

If I pointed you to Freek's Laracon 2019 talk, would that be where you came across it?

https://youtu.be/FxACh4X-Xc0. @11:30

Activity icon

Replied to Roles In Laravel 6?

create a user model in laravel and authenticate the user against the external source.

You then have a user model you can hang roles and permissions off.

How else will you determine each user's rights?

Activity icon

Replied to Using FirstWhere And Update Other Duplicats

grab the first of them

first in what respect? oldest, youngest, lowest id, highest id, most recently updated?

Activity icon

Replied to SQLSTATE[HY000] [1045] Access Denied For User 'root'@'WINSERVER2008' (using Password: YES)

Why would it affect other projects?

This is just what happens when you reboot the server (which you should do regularly and not be afraid of)

Anyway, have you changed permissions on mysql or just something in your application configuration?

If you have created an account on mysql or changed a password, it should just work. If you have changed privileges then you can 'Flush Privileges'

Can't think of any reason to restart mysql unless you have changed the port being used.

Activity icon

Replied to How To Store Multiple Checkboxes Values In Same Table At Same Time

Your checkboxes are two independent lists, you should not have them nested one inside another.

They are also unrelated in so much that you could have 10 * sg checkboxes and just 1 br checkbox. How many records should be created in this case?

How many MechanicServiceStationInfo do you expect to be created each time you call your store method?

Is a checkbox the correct type of input control in this circumstance?

Activity icon

Replied to Laravel Excel Export Warning

Do you get the error if you don't set the Toast alert?

Oct
20
2 days ago
Activity icon

Awarded Best Reply on Official Standard For Favicons?

one ov the on-line favicon generators will do this for you

https://realfavicongenerator.net

Activity icon

Replied to Official Standard For Favicons?

one ov the on-line favicon generators will do this for you

https://realfavicongenerator.net

Activity icon

Replied to Data Format Issue In Mysql

HAVE YOU CHECKED WHAT DATE FORMAT COMES FROM YOUR FORM ?

otherwise you are just stumbling around

Activity icon

Replied to How To Create Master In Php?

Post your question on Stack Overflow. Everyone here is into Laravel and cannot understand why you don't consider using blade

Activity icon

Awarded Best Reply on Model Manipulation Before Every Call

Can't it all be in a service provider (or repository class), and then inject that into your controller instead of the model?

Oct
19
3 days ago
Activity icon

Replied to How Can I Save Multiple Checkboxes Into Multiple Column Using Laravel

please format your question correctly. put three backticks on a line before and after your code

Activity icon

Replied to Using Relationship Column In A Query

sorry, not a good solution. What is your query count?

Activity icon

Awarded Best Reply on How Do You Instantiate Variables In An Event Based Markdown Mail?

@trevorpan

depends what bidreserve->complete() does. That function should be attaching the order.

Activity icon

Replied to Eager Loading On Single Eloquent Object

Not related to the question (->load() is the correct answer) but how can you load tags when you have not associated any with the model you just created?

Activity icon

Replied to Which Data Type Supports Integer That Start With 0

when you do what with it? Its not going to just change itself. Show some code?

Activity icon

Replied to Which Data Type Supports Integer That Start With 0

use regular integer, then create an accessor in eloquent model

public function getSupportNoAttribute()
{
    return sprintf("%09d", $this->supportNo);
}

replace supportNo with your column name

If the column is also a primary key, you should give this accessor a different name

Activity icon

Replied to How Do I Make My HasOne Connection Cleaner?

you should not need to use first since its a hasOne relationship

what sort of relationship comes the other way?

Activity icon

Replied to Using Relationship Column In A Query

$query = Buy::with('catbuy')->whereIn('catbuy', $category)

You are working with Buy model. Does Buy model have a catbuy column?

Activity icon

Replied to Using Relationship Column In A Query

Are you sure this is Laravel code?

Activity icon

Replied to Smtp.mailtrap.io - Connection Refused

If you have command line access, run php artisan tinker then config('mail') and check the values are what you expect

Activity icon

Replied to Query Eloquent BelongsTo And HasMany (laravel-datatables)

perhaps you have an order with no order details?

Edit

Actually, no, this is not going to work. You have MANY order details per order. You cannot list order and order details on the same row of a table due to the 1:many relationship

$clientes->orderdetails is a collection of orderdetails linked to order. You cannot pluck out a single 'name' since that would require it be a 1:1 relationship

Activity icon

Replied to Multiple Queued Jobs With A Single Callback (1-n-1)

Why not just pass it as data directly to the page when you render it?

Oct
18
4 days ago
Activity icon

Replied to Best Way To Add Messages To A Request?

If you have multiple conditions to test, then unfortunately, a lot of if statements are going to be required.

Activity icon

Replied to Issues With Laravel URls

Still spam

@siangboon please mark this as spam

Activity icon

Replied to How Do You Instantiate Variables In An Event Based Markdown Mail?

Well you have a mixture of $job and $this->job Are they the same? should you be using one and not the other?

Have you checked that $job you are passing to the complete method is a model instance and not null or a collection of models?

Activity icon

Replied to Query Eloquent BelongsTo And HasMany (laravel-datatables)

You are going to have to be explicit about the key names since you don't follow convention.

Add the local and foreign keys to each relationship.

Also in your controller, did you mean to get all orders for all clients?

Activity icon

Replied to Dynamic Routing With Slugs

You can still accept those parameters as if you were going to use them.

Keep the URL like

Route::get('/professionals/{stateSlug}/{citySlug}/{nameSlug}/{professional}')->name('show-professional')

but just pass a large part of it direct from the slug.

It might mean that the route() helper has difficulties so you might not be able to use that

Activity icon

Replied to Issue With Sending Data From My Backend To Frontend After Redirect

How about redirecting with a query string parameter, ie /?login=true

Then in the home page controller you can pass a prop to the view

Activity icon

Replied to Adapt My Code By Adding Start_time And Stop_time In My Booking

don't know what you mean?

When checking for conflict, you are looking for models that have;

  • start between $start_time and $end_time, or
  • end between $start_time and $end_time, or
  • start earlier than $start_time AND end later than $end_time

Your code also has an issue in that you use $date_seance and $hour_start/end before initialising them

Activity icon

Replied to Smtp.mailtrap.io - Connection Refused

Did you test mailtrap locally first or have you changed the .env whilst its on godaddy?

Activity icon

Replied to Performance On Saving Model Images In An Array Vs Tables.

Try out the Spatie media library.

You can either use that, or you can use it as inspiration to build your own version.

https://github.com/spatie/laravel-medialibrary

It uses an images model to save image metadata and uses polymorphism to link the images to any other model that needs to store images. Against the media library, you can store transformations and when you save an image it will create versions of the image in the sizes you requested.

It also comes with a function that creates srcset image tags that serve the most appropriate size image to the user

Activity icon

Replied to Scheduler - Skipping Jobs - Looking At Using RunInBackground

Have you considered simply spacing the commands apart?

I have to admit, It was my understanding that the time is taken when schedule:run is called and that all applicable jobs would run even if several minutes had passed.

As a first step, space them at 8:00, 8:05, 8:10 etc and see if this avoids the problem. If you still have missing jobs then maybe its something else.

Activity icon

Replied to Query Eloquent BelongsTo And HasMany (laravel-datatables)

You also need to name your variables correctly

this

$ordenes->details->name. 

is expecting $ordenes to be an order, but its not, its a collection of clients.

Activity icon

Replied to Query Eloquent BelongsTo And HasMany (laravel-datatables)

If you are having problems with this

$ordenes =Client::with (['orders, orders.details'])->get(); 

then you need to show the Client model so we can see the orders relationship

Ideally also, your migrations.

Activity icon

Replied to Auth::viaRemember() Doesn't Work

Please format your code by putting 3 backticks ``` on a line before and after each code block

Activity icon

Replied to Server For Laravel Project (germany)

depends if you need platform as a service or just bare metal VPS?

Activity icon

Replied to Modify Model Data In 'created' Event

Seems a strange process to follow, but should work.

Are you sure its going into the if(data) section?

Why don't you put the files in the correct place to start with?

Activity icon

Replied to "Responsive" Email Templates

perhaps read https://www.smashingmagazine.com/2017/01/introduction-building-sending-html-email-for-web-developers/

but yes, html email is primitive and still largely relies on table based layout, inline styles and standard fonts.

Activity icon

Replied to Laravel Storage Pemission

run the cron under www-data account. When you create the cron, specify the user

sudo crontab -e -u www-data

(I think thats the correct syntax)

Now both are creating the log file with the same account.

Activity icon

Replied to Can I Observe / Listen To Model's Save-and-commited Event?

Perhaps throw your own event after the transaction is committed?