jaynarayan

Software Engineer at India

Member Since 5 Months Ago

Experience Points
2,820
Total
Experience

2,180 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
23
Lessons
Completed
Best Reply Awards
0
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 1
2,820 XP
Nov
30
1 month ago
Activity icon

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);
Nov
26
1 month ago
Activity icon

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.```
Nov
25
1 month ago
Activity icon

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.
Activity icon

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>
Nov
17
2 months ago
Activity icon

Started a new Conversation Package For Generating /scafolding Tests?

Is there any Laravel package for generating boilerplate test for an existing app?

Nov
15
2 months ago
Activity icon

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?

Activity icon

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.

Aug
18
4 months ago
Activity icon

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?

Aug
17
5 months ago
Activity icon

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.

Activity icon

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?

Aug
15
5 months ago
Activity icon

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?

Aug
14
5 months ago
Activity icon

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.

Activity icon

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);
Jul
23
5 months ago
Activity icon

Commented on Style The Index Page With Tailwind CSS

If you are on ubuntu you can use norde source app instead of iconjar.