2,180 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.
Started a new Conversation __toString() Not Working In Class Extended From DateTIme
Does the __tostring() work wtih date created with createfromformat() metod?
in the following code echo $z
is working but echo $x
gives error.
class TheDate extends DateTime{
public function __toString()
{
return $this->format(Self::COOKIE).'<br/>';
}
}
$z = new TheDate;
echo $z;
$x = TheDate::createFromFormat('d/m/y','29/12/89');
var_dump(TheDate::getLastErrors());
echo $x;
var_dump($x);
Started a new Conversation Cookie Already Expired Warning In Sanctum.
After login, I got the following warning:
Cookie “TF9oSxYxS977w2RzEP466WNtbKVUI2YwQhTwFTEO” has been rejected because it is already expired.```
Replied to 401 Error For Sanctum Auth ,even If Succesfully Loged In.
Thanks for your help . your suggestions helped me. I found that there was a mistake in my login code too. I forgot to do following
axios.get('/sanctum/csrf-cookie').then(response => {
// Login...
});
After using this code now I can can fetch loged in user data, however I am getting following warning in console
Cookie “TF9oSxYxS977w2RzEP466WNtbKVUI2YwQhTwFTEO” has been rejected because it is already expired.
Started a new Conversation 401 Error For Sanctum Auth ,even If Succesfully Loged In.
My login code is working because when I log in ,I get loged in user in response ,however when i trying to display user on dashboard component.
api.php
Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
return $request->user();
});
my env settings
SESSION_DRIVER=cookie
SESSION_LIFETIME=120
SESSION_DOMAIN=http://myspa.loc
SANCTUM_STATEFUL_DOMAINS=http://myspa.loc
my bootstrap.js
window._ = require('lodash');
window.axios = require('axios');
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
cors.php
'paths' => ['api/*', 'sanctum/csrf-cookie'],
'allowed_methods' => ['*'],
'allowed_origins' => ['*'],
'allowed_origins_patterns' => [],
'allowed_headers' => ['*'],
'exposed_headers' => [],
'max_age' => 0,
'supports_credentials' => true,
]
in my dashboard component
<script>
export default {
data() {
return {
user:[]
}
},
mounted(){
axios.get('/api/user').then((res)=>{
this.user = res.data;
})
}
}
</script>
Started a new Conversation Package For Generating /scafolding Tests?
Is there any Laravel package for generating boilerplate test for an existing app?
Replied to How To Disable Route Cache During Development. (without Artisan Optimize Or Cache : Clear)
@tisuchi this is not working for route:cache
Replied to How To Disable Route Cache During Development. (without Artisan Optimize Or Cache : Clear)
I am looking for disable caching. Is there any config option or other way?
Started a new Conversation How To Disable Route Cache During Development. (without Artisan Optimize Or Cache : Clear)
I don't want to use artisan optimize or clear: cache everyt ime I update my route files.
Started a new Conversation Extending Laravel Validation
how to use an inline custom message array?
my code:
class CustomValidatorServiceProvider extends ServiceProvider
{
...
public function boot()
{
Validator::extend('alpha_space', function ($attribute, $value, $parameters, $validator) {
return preg_match('/^[a-zA-Z ]$/', $value);
});
}
}
As per user docs
Defining The Error Message
You will also need to define an error message for your custom rule. You can do so either using an inline custom message array or by adding an entry in the validation language file. This message should be placed in the first level of the array, not within the custom array, which is only for attribute-specific error messages:
I dont want to use validaton languaje file. how can i use inline custom message array?
Replied to AR Models
LOL, I did that before posting thread, and came to know that this may be releated to mathemetical AR model. I just wanted to make sure that what jeffery meant in context of laravel.
Started a new Conversation AR Models
@jeffreyway mentioned about "could stats be a dedicated AR model?" in his talk at Laracon 2017. anybody knows what is it?
Commented on God Object Cleanup #1: Pass-Through
@jeffrey mentioned about 'could stats be a dedicated AR model?' in his talk at laracon 2017. anybody knows what is it?
Replied to Need Help To Understand Flock() Of Core Php.
Actually I am trying to fail the file_put_contents() for learning purposes. If the file is locked by another process ,file_put_contents() will return false. I have locked file using flock() so it shouldn't be accessible by file_put_contents() until I call fclose() or script ends.
Started a new Conversation Need Help To Understand Flock() Of Core Php.
why $r is not false?
$fileHandle = fopen('mylines.txt','r+');
flock($fileHandle,LOCK_EX);
$r = file_put_contents('mylines.txt','should return false');
var_dump($r);
Commented on Style The Index Page With Tailwind CSS
If you are on ubuntu you can use norde source app instead of iconjar.