Greeenone

Member Since 1 Year Ago

Experience Points
650
Total
Experience

4,350 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
0
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
650 XP
Nov
25
1 month ago
Activity icon

Replied to Laravel Throw Error Due To Another "From" Email

Hey,

Thanks for reply.

I fixed my issue by using replyTo instead of from. I don't know why, but on Laravel 6 "from" worked

Activity icon

Started a new Conversation Laravel Throw Error Due To Another "From" Email

Hello,

On my website I have a contact form that send two emails:

  • Confirmation email to person who contacted me using form
  • Second mail to my inbox with message

I want to send to my inbox message from sender email (For direct reply) but laravel throw an error

public function build()
{
    return $this->subject('Message de contact')
    ->from('[email protected]', 'Example')
    ->view('emails.contactMessage');
}

And I get this error:

message: Expected response code 354 but got code "503", with message "503-All RCPT commands were rejected with this error: 503-Sender verify failed 503 Valid RCPT command must precede DATA "

Edit I fixed my issue using "replyTo" and not "from"

Sep
02
4 months ago
Activity icon

Started a new Conversation Laravel And ICloud / Google Calendar - Some Questions

Hello,

I'm using Fullcalendar for my web app and each event is stored in mysql db. Each customer have his own calendar with own events (Added by this customer)

Now I want to create synch with customers calendars. I want to do this like this:

  • User get custom url to his own calendar in csv format
  • User can add this url to his calendar and get all events

I would like to know which method is better? Create a new file on each event add / delete or append data to existing file

And I will use this: https://github.com/spatie/laravel-google-calendar

I want also to synch user calendar with my app calendar but is it possible?

Aug
23
4 months ago
Activity icon

Replied to CORS Preflight Issue After Login

Hi, thanks for reply!

I added middleware with Cors. My steps:

Creating cors middleware using php artisan command

I added this code to cors.php file

    {
        return $next($request)
        ->header('Access-Control-Allow-Origin', '*')
        ->header('Header set Access-Control-Allow-Methods', 'GET, POST, PATCH, PUT, DELETE, OPTIONS')
        ->header('Header set Access-Control-Allow-Headers', 'Origin, Content-Type, X-Auth-Token, Authorization, Accept');
    }

And inside kernel.php:

    protected $middleware = [
        ...
        \App\Http\Middleware\Cors::class,
	...
    ];

And I have still the same error

Activity icon

Started a new Conversation CORS Preflight Issue After Login

Hello,

I have an app in Laravel and VueJS (Separated). On domain.com I have frontend and on api.domain.com I have all my backend. Yesterday, I spended entire day to find where CORS are not working. Finally I founded solution. I added to my Htaccess file this code:

<IfModule mod.headers. c>
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET, POST, PATCH, PUT, DELETE, OPTIONS"
Header set Access-Control-Allow-Headers "Origin, Content-Type, X-Auth-Token, Authorization, Accept"
</IfModule>

On login page, GET (for check if register is enabled) and POST (for credentials) are not longer blocked by CORS but after success login, everything is blocked and I don't know why

Sending credentials -> Check -> Response 200 with token

When my app is trying to redirect me to dashboard, all requests are blocked by CORS:

Access to XMLHTTPRequest at 'X' from origin 'x' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: redirect is not allowed for a preflight request.

Reason: CORS request external redirect not allowed
Reason: CORS preflight response did not succeed
Reason: CORS request did not succeed

I don't know what I'm doing wrong. All responses from my controller are set to 200

Aug
10
5 months ago
Activity icon

Replied to Do I Understand Correctly Policies?

@sinnbeck Ok, thanks you again. Only logged users can access this page. Once logged, they get list of students where user_id === logged user id. I think it's not necessary to use policies.

Activity icon

Replied to Do I Understand Correctly Policies?

@sinnbeck Thank you very much for your reply, very helpful!

I have juste another very quick question. If I'm using auth user id for data retrieve, I also need to make validation for them? For exemple:

Students::where('teacher_id', request()->user()->id)-get();

?

Activity icon

Started a new Conversation Do I Understand Correctly Policies?

Hello,

I started using policies but I don't know if I understand correctly policies "schema"

So,

  1. Inside AuthServiceProvider file:

Post::class => PostPolicy::class

This code allow to use policies inside Post controller or which model use/refer to which policy?

  1. Inside PostPolicy file

public function view(User $user, Post $post)

02a. Param inside view function refer to models? Or data come from controller, (Autorize)? 02b. Can I add more params?

03.Inside controller file, view function:

$this->authorize('view', Post::class)

Post:Class is used to find correct policy? (Post -> PostPolicy -> view function inside policy)?

Jul
25
5 months ago
Activity icon

Started a new Conversation Additional Data In Sanctum - Work And Throw An Error At The Same Time

Hello,

I'm trying to additional data for sanctum (IP adress). Everything work fine (Sanctum create token, save it to db etc) but throw an error a the same time.

How I add data:

  1. Creation of model PersonalAccessTokens with protected filable.

  2. Adding inside AppServiceProvider in boot function: Sanctum::usePersonalAccessTokenModel('App\PersonalAccessTokens');

  3. Adding inside User model:

public function createToken(string $name, array $abilities = ['*']) { $token = $this->tokens()->create([ 'name' => $name, 'ip_address' => request()->ip(), 'token' => hash('sha256', $plainTextToken = Str::random(80)), 'abilities' => $abilities, ]); return new NewAccessToken($token, $token->id.'|'.$plainTextToken); }

4.Creation of token using:

$token = $user->createToken($request->device_name)->plainTextToken;

Sanctum add data to DB (token, ip, etc) but throw also this error:

Argument 1 passed to Laravel\Sanctum\NewAccessToken::__construct() must be an instance of Laravel\Sanctum\PersonalAccessToken, instance of App\PersonalAccessTokens given, called in

Jul
24
5 months ago
Activity icon

Replied to Storing Additional Data In Sanctum

Thanks for reply!

I want to use these data in "active session" tab inside my app. When user log in, vue check browser, ip and device. After that, axios join these data to post request with credentials.

Activity icon

Started a new Conversation Storing Additional Data In Sanctum

Hello,

I have a quick question about Sanctum.

I want to add additional data to Sanctum:

  • Device type
  • Browser
  • IP adresse

I'm sending everything using post from my frontend (Token, credentials, device type etc).

Which file inside Laravel get all data and transfer it to the DB?