sr57

Member Since 2 Months Ago

Experience Points
35,310
Total
Experience

4,690 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
110
Lessons
Completed
Best Reply Awards
26
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 8
35,310 XP
Jan
24
10 hours ago
Activity icon

Replied to Xdebug Alternative?

Thanks @bugsysha

Thanks @jlrdw , I agree with you , I know debug in general, never used for php (till now). But my question is about 'profiling', I have a 'complex' job that I need to reduce duration as better as I can. Till now, microtime(true) and looking in the main loop(s) was enough but this time I have many different loops in several recursive functions. (including changing the language of the heart ... but it should be another question)

Jan
23
1 day ago
Activity icon

Awarded Best Reply on Delete File On Disk When Deleting Related Record In Db

You can't disable a trigger, so if you put a before trigger when you delete a repo, triggers will act on each file, and it works.

If you can have a lot a file per repo this solution is not to use, so do not use trigger (for file deletion) and put the logic in controller.

Activity icon

Started a new Conversation Xdebug Alternative?

I just wonder if anyone use other tool than XDebug to profile php codes? And why?

Jan
22
2 days ago
Activity icon

Replied to Data Return Null

Yes but tired :-)

Activity icon

Replied to Data Return Null

You forgot the get

$obj = DB::table("V_PRENOTAZIONI_SHARING") ->where("id_prenotazione", 360) ->where("f_principale", "=",1) ->get()->first();

Activity icon

Replied to How To Update Data In A Production Database?

Hello @maxtenco , what are you afraid of?

Same answer as my first one : YES

If you are not comfortable to do this for the first time in prod, try it on a app test in prod, and always have your an updated backup.

Activity icon

Replied to How Can I Generate 10 Digit Unique Number That Will Be Sent To User After Registration On Laravel

In 2 times +

  1. $rn=rand(0,9).rand(0,9) ... (10 times or better with a loop)

1.1) better with @martinbean solution (Laravel solution versus plain php with rand)

  1. Check if this number does not exist for a user

  2. redo 1 & 2 if already exists (very low probability)

Activity icon

Replied to How To Update Data In A Production Database?

same as insert, seeder.

Activity icon

Replied to How To Update Data In A Production Database?

Your question was about to insert a record :-), for this you have to use a seeder

If you want to add a field (or do other change in the db structure), use migration of course.

Activity icon

Replied to How To Update Data In A Production Database?

First you have to know (application specific) that your update will not change st bad ...

That said, let's assume that add a category is not a sensible update you can :

  1. quickest way (test) : directly insert in the db

  2. better way ie laravel one shot way (app updated) : write et run a seeder

  3. if can/must be done by user : :write a form

Activity icon

Replied to [L8] Help With "NOT NULL Constraint Failed: Failed_jobs.uuid"

Strange if you don't change migrations! Can you re-create* your db and rod the test.

  • php artisan migrate:refresh
Activity icon

Replied to Tests Don't Recognize A Table, That Has Been Migrated

Hi @foks

So you have a pb with your db ... and sqlite is probably not updated.

Activity icon

Replied to Error On Npm Run Dev Using Jetstream:inertia

Is-it a fresh version of Laravel/Jetstream?

I should try 2 things

  1. réinstall node

https://phoenixnap.com/kb/update-node-js-version

  1. do a fresh new version of Laravel/Jetstream and compare
Jan
21
3 days ago
Activity icon

Replied to Tests Don't Recognize A Table, That Has Been Migrated

Try recreate totally the db

php artisan migrate:refresh

Activity icon

Replied to Tests Don't Recognize A Table, That Has Been Migrated

Strange ... does your test connect to the right db?

Activity icon

Replied to Tests Don't Recognize A Table, That Has Been Migrated

Does the table permissions exist in the db?

Can you show your migrations and tests?

Activity icon

Replied to Optimize Queries For Performance

Very BEST answer :-) Thanks @chaudigv

Activity icon

Replied to Any Advice On Testing Traits

Thanks @bugsysha

Usually they group similar logic

Can be useful, I'm used to do this by (bash) scripts over my code, should be a better (more standard) solution. I'll see in the future.

Activity icon

Replied to Any Advice On Testing Traits

Thanks @nimrod , never heard before.

Activity icon

Replied to Any Advice On Testing Traits

Hi @bugsysha @marketintelligence

English is not my mother-tongue language, what's the meaning of 'trait'?

Activity icon

Replied to How To Keep Selected Value In Dropdown After Submit In Laravel

Have a look of the variable old('status') (use dd or dump for example ) and/or a look in the source of html page in your browser.

Activity icon

Replied to Cannot Use Table Alias When Using Soft Deletes.

Hy @tray2

irrelevant better than incorrect?

The question concerns table alias and not column alias.

Activity icon

Replied to How To Keep Selected Value In Dropdown After Submit In Laravel

In your code your selected option is disabled & hide, you should put your 'old value' , enable it and probably not hide it.

Activity icon

Replied to How To Solve "Array To String Conversion" In Laravel

You are lost, it's a second error.

Post your error log concerning 'Array to string conversion' here between 3 ` like your code, it's easier to read than your image.

Activity icon

Replied to How To Solve "Array To String Conversion" In Laravel

You should look at the error stack, to see which line of you original code is concerned.

have a look in the last error in the file : storage/logs/laravel.log

Activity icon

Replied to How To Solve "Array To String Conversion" In Laravel

Can you show the error logs?

Activity icon

Replied to Retrieving Variable From One Form To Another

Hi @prudencesedo

PHP is stateless, session variables is the 'standard' way to store 'states', after you can use other 'solutions', put in a file, put in a cookie, put in the url, put in the db, ... just choose the one that feet your need.

Activity icon

Replied to How To Solve "Array To String Conversion" In Laravel

Nor specific to Laravel, just a 'classic' php error

Array to string conversion

means you put an array where a string is needed.

Have a look to your log to see the line number, dd the variable(s) et correct your code.

Activity icon

Replied to Sorting Foreach By Another Variable

If you do not do the job in the db, either you have the right associative array or first you construct it

Then the easiest way to do a simple sort on an associative array is to use

asort : to sort by value

ksort : to sort by key

then you can foreach ...

and if you need to reverse key/value you can use array_flip

Jan
20
4 days ago
Activity icon

Awarded Best Reply on Why Private IPs Are Differentiated From Public IPs?

Hi @osama_abdullah , theroicaly you are not wrong but doing this will :

  • be confusing (looking at an IP to know if it's public or private and mainly for many tools that deals with that standard)

  • give a very little (<1%) more number of new public IP and far less the need and IPV6 standard.

IPV4 = 2^32 = 4*10^9 (less than one IP per person on Earth)

IPV6 = 2^128 ~10^39 that's 10^21 more ! (each of us on Earth can have 10^11 IP addresses, should be enough for a long time)

Activity icon

Replied to I Want To Build Up Schedule SMS Service Using Laravel.

You can use gammu/wammu or directly adb

Jan
19
5 days ago
Activity icon

Replied to Eloquent Is Passing Invalid Parameters To SQL Queries From A Model

With Eloquent you must use 'right naming' for keys

Remember, Eloquent will automatically determine the proper foreign key column

https://laravel.com/docs/8.x/eloquent-relationships#one-to-many

Without Eloquent you must define you foreign key in your migration

Activity icon

Replied to Eloquent Is Passing Invalid Parameters To SQL Queries From A Model

Right, I read and posted my answer too quickly. Can you show your migration?

Activity icon

Replied to Eloquent Is Passing Invalid Parameters To SQL Queries From A Model

You forgot the line

$feature->model_number = ...

Activity icon

Replied to If/else Works With A Determinate Class Only.

In your css define an 'alias' class name and use it where you don' want the log

.my-class-2, .my-class-2_1 { //styles }

Activity icon

Replied to If/else Works With A Determinate Class Only.

When you pass over 'HOVER THIS CLASS 1' you enter in a row the 2 div , your result is normal.

Try to put a 3rd class and you'll see 3 logs, or to reverse the div and your log will be reverse.

Activity icon

Replied to Laravel Performance Optimization

Not a laravel pb, use db tools to improve query performance.

Jan
18
6 days ago
Activity icon

Replied to Why Private IPs Are Differentiated From Public IPs?

Hi @osama_abdullah , theroicaly you are not wrong but doing this will :

  • be confusing (looking at an IP to know if it's public or private and mainly for many tools that deals with that standard)

  • give a very little (<1%) more number of new public IP and far less the need and IPV6 standard.

IPV4 = 2^32 = 4*10^9 (less than one IP per person on Earth)

IPV6 = 2^128 ~10^39 that's 10^21 more ! (each of us on Earth can have 10^11 IP addresses, should be enough for a long time)

Activity icon

Replied to Performance Anxiety: 1 Big Table Or 2 Smaller Tables?

Option B is better than A in absolute but, with good index and cache in service you'll see no difference till all your data will be in memory, real advantage will arrive when table A that should be the smallest size will still be in memory and not table B.

Don't forget that there good tools to optimize sql in mariadb or postgresl.

Activity icon

Replied to Collections 'remove' Method ?

HI @levitorres If you don't find the answer in this subject, open a new one, this one is close and few people will see your question.

Activity icon

Replied to Nl2br Don't Respectbreaks Lines \n

t works fine by me just dump($task->select) , maybe it does not contain expected data.

Activity icon

Replied to Fetch Only Id From Array

$ts=array( array('id' => '27','slug' => 'moderne-kommunikation'), array('id' => '26','slug' => 'nachwuchs-binden') );

	$c=collect();
	foreach ($ts as $t) $c=$c->mergeRecursive($t);
	$r=$c['id'];
Activity icon

Replied to Delay Batch Jobs

Yes, the same, it just makes you create a non mandatory job.

Activity icon

Replied to Delay Batch Jobs

Hi @npalmqvist

Just select one as best answer, ti can be yours (if you want to reformulate a conclusion), in general try to select the one that help the most you.

Jan
17
1 week ago
Activity icon

Replied to Delay Batch Jobs

Why not if that's feet your need, personally I think it's a little more complicated; Let's know where you are with your memory pb and don't forget to close your subjects.

Activity icon

Replied to Gmail SMTP Is Not Working On Laravel 8.12

For gmail don't forget to go in the parameters of you account o activate 'less secure app' (and pop/imap if needed) et less known

https://accounts.google.com/DisplayUnlockCaptcha

Have a look to the mail(s) sent by gmail to your account.