Member Since 2 Months Ago
4,690 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
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.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
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)
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.
Started a new Conversation Xdebug Alternative?
I just wonder if anyone use other tool than XDebug to profile php codes? And why?
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();
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.
Replied to How Can I Generate 10 Digit Unique Number That Will Be Sent To User After Registration On Laravel
In 2 times +
1.1) better with @martinbean solution (Laravel solution versus plain php with rand)
Check if this number does not exist for a user
redo 1 & 2 if already exists (very low probability)
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.
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 :
quickest way (test) : directly insert in the db
better way ie laravel one shot way (app updated) : write et run a seeder
if can/must be done by user : :write a form
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.
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.
Replied to Error On Npm Run Dev Using Jetstream:inertia
Is-it a fresh version of Laravel/Jetstream?
I should try 2 things
https://phoenixnap.com/kb/update-node-js-version
Replied to Tests Don't Recognize A Table, That Has Been Migrated
Try recreate totally the db
php artisan migrate:refresh
Replied to Tests Don't Recognize A Table, That Has Been Migrated
Strange ... does your test connect to the right db?
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?
Replied to I Search Graph Presentation Library
I use FusionCharts
https://www.fusioncharts.com/blog/charts-laravel-web-application/
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.
Replied to Any Advice On Testing Traits
Hi @bugsysha @marketintelligence
English is not my mother-tongue language, what's the meaning of 'trait'?
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.
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.
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.
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
Replied to Retrieving Variable From One Form To Another
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.
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.
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
Replied to Retrieving Variable From One Form To Another
You can use session variables
First store the data
https://laravel.com/docs/8.x/session#storing-data
Then use it where you want
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)
Replied to I Want To Build Up Schedule SMS Service Using Laravel.
You can use gammu/wammu or directly adb
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
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?
Replied to Eloquent Is Passing Invalid Parameters To SQL Queries From A Model
You forgot the line
$feature->model_number = ...
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 }
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.
Replied to Laravel Performance Optimization
Not a laravel pb, use db tools to improve query performance.
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)
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.
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.
Replied to Nl2br Don't Respectbreaks Lines \n
t works fine by me just dump($task->select) , maybe it does not contain expected data.
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'];
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.
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.
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.