markotitel

markotitel

Member Since 6 Months Ago

Experience Points 7,310
Experience Level 2

2,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 54
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

16 May
3 days ago

markotitel started a new conversation Getting Object In The Place Of ENV Var

Hello. This is part of the code of the js file which is being compiled.

window.Echo = new Echo({
    broadcaster: 'socket.io',
    host: window.location.hostname + ':' + process.env.MIX_BROADCAST_PORT
});

The issue is that if this MIX_BROADCAST_PORT var is not defined the compiled code is like this.

window.Echo = new __WEBPACK_IMPORTED_MODULE_0_laravel_echo___default.a({
    broadcaster: 'socket.io',
    host: window.location.hostname + ':' + Object({"NODE_ENV":"development"}).MIX_BROADCAST_PORT
});

If I define that ENV var even without a value. The code compiles fine. What is the catch here? =)

07 Feb
3 months ago

markotitel left a reply on Laravel Forge What Does Enable Quick Deploy Actually Do?

@MANELGAVALDA - How does Enable Quick Deploy knows that something is pushed to my git repository?

So far I was using Deployment Trigger URL webhook from Gitlab.

markotitel started a new conversation Laravel Forge What Does Enable Quick Deploy Actually Do?

We have Enable Quick Deploy and Deployment Trigger URL

What is the difference?

09 Jan
4 months ago

markotitel started a new conversation Laravel Tymon JWT Check User Auth From Outside Laravel

I hope the title is at least near what I need.

We have existing Laravel 5.7 app which is using JWT Tymon for api auth.

How should I approach writing external "script" it will reside in AWS as a Lambda function.

That function will get users JWT token check it against Laravel app and act properly depending on if that user has Auth and Authorization or not.

How should I query Laravel to check if that token is valid for auth and authorization.

08 Jan
4 months ago

markotitel left a reply on Run Laravel Without Storage Permissions

I would accept Snapey answer because it is the correct answer here. Along the way provided URL is fine. But the answer was already provided by @Sn

06 Jan
4 months ago

markotitel left a reply on Low Request Per Second With Laravel, Docker, And AWS

Have you managed to get through this?

markotitel left a reply on How To Start Out With Automated Scripted Deployment? Help

Have you mentioned Forge in your original question?

Is Forge ultimate tool for you?

Forge does not handle Cron, queues.

ElasticBeansTalk is management tool, not a service.

I am not sure how you are not sure that ElasticBeanstalk cannot work with your current setup.

markotitel left a reply on Laravel (Login) Not Working In Shared Hosting

@SNAPEY - Is previous data filled by default?

markotitel left a reply on Laravel (Login) Not Working In Shared Hosting

Is the previous data filled by default?

markotitel left a reply on Laravel (Login) Not Working In Shared Hosting

@ANOUD - ``` [2019-01-06 00:53:55] local.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost'

This tells me that access is denied for user [email protected]

What I would do is delete `laravel.log` from shared hosting, try to login again, then check laravel log again.

markotitel left a reply on Laravel (Login) Not Working In Shared Hosting

@ANOUD - You should give more details Anoud.

No one can magically help you.

I've already wrote UP. What we need is laravel.log

Lets start from there first.

Can you share the login controller also

markotitel left a reply on Laravel (Login) Not Working In Shared Hosting

How did you do the migrations?

markotitel left a reply on Laravel (Login) Not Working In Shared Hosting

@ANOUD - Have you tried dd() the form data?

Have you successfully created POSTS on the shared hosting?

Is the code the same?

markotitel left a reply on Laravel (Login) Not Working In Shared Hosting

@JLRDW - ``` I just deployed my project on Sharing host (HostGator), and everything was working correctly. I tried the registration is working I create some post everything is perfect.


I guess it is setup correctly.




@anoud 

What we need is laravel.log

Try to `dd()` login controller and see form data that you post to login.

How did you create POST in the first place if you cannot login? If you register another user is is automatically logged in?

markotitel left a reply on Github Security Vulnerability

Why do you think this is Laravel question?

markotitel left a reply on How To Start Out With Automated Scripted Deployment? Help

Hi,

Have you manually setup load balancing and EC2 instances, or do you use ElasticBeansTalk? If you will use AWS then I would suggest ElasticBeanstalk as your applilcation manager.

Regarding "general" scaled Laravel setup,

Assets and storage should be shared. ( That I assume you are aware ) CI/CD workflow basically consists of getting the code packed and pushed to the servers.

Lets say you have fixed number of servers behind loadbalancer.

Setup a cronjob that will check your GIT repo and pull the changes, do the necessary commands like composer npm artisan and any other specific to your project.

That is basic approach which works well.

Now if you have dynamic scaling, then you could do the same approach just add needed commands in startup script cloud-init.

You should store your variables somewhere for the servers to fetch them.

One approach is to use ready made tools liek Gitlab CI/CD pipelines.

I would not go to Docker as a solution just because it is "modern" and is hyped everywhere. Depends on your needs but you will not gain anything with simply deciding to go with docker until you grasp of your entire automation workflow.

CloudFormation is a templating language which provisions AWS services.

ElasticBeansTalk is a free tool which provisions CloudFormation script and sets everything for you. Afterwards, you simply upload ZIP archive of your application and it automagically deploys to all instances. It also takes care of autoscaling for you.

If you will use AWS go for ElasticBeansTalk.

I am using it for bunch of PHP Laravel apps.

25 Dec
4 months ago

markotitel left a reply on Laravel Queues In A Scaled Environment.

If it is allowed, I will mark this question resolved.

Horizon is the answer.

Something I did not know before testing it today.

Default number of Horizon workers is 10. Killed my nano (512MB ram) instances = )

24 Dec
4 months ago

markotitel left a reply on Laravel Queues In A Scaled Environment.

Seems that Horizon is the choice. If someone can confirm I would gladly accept his/hers confirmation as an answer.

markotitel left a reply on Laravel Queues In A Scaled Environment.

I guessed so. It should be "smarter" way. Lets wait for more opinions. Thanks for answer.

markotitel started a new conversation Laravel Queues In A Scaled Environment.

I have multiple servers behind loadbalancer.

Should I run artisan queue:work on all servers or just on a single server.

Is there any race condition possibility?

15 Dec
5 months ago

markotitel left a reply on Low Request Per Second With Laravel, Docker, And AWS

The point was to try this app outside the Docker to see if docker is the bottleneck. But I doubt that.

There is also CPU Credits property on EC2 instances. When depleted your instance will run at 5 - 25% capped.

Try first on some test DigitalOcean, or whatever small VPS to see what you will get there. Setup database on the VPS itself and lets see the results.

markotitel left a reply on Low Request Per Second With Laravel, Docker, And AWS

@BEERBUDDHA - try also php artisan route:cache php artisan config:cache

markotitel left a reply on Low Request Per Second With Laravel, Docker, And AWS

@BEERBUDDHA - As @ohffs suggested.

Try do add route cache, config cache and optimise autoloader to see what will happen.

Also metrics from AWS Console EC2 instance may hold some info.

markotitel left a reply on Low Request Per Second With Laravel, Docker, And AWS

@BEERBUDDHA - Lets see more metrics here.

Do the load test and provide EC2 instance metrics from AWS console.

If possibile install htop or use simple top command wile loadtesting and post screenshots, will be much easier to think of reasons why.

markotitel left a reply on How To Set Up Cronjobs In AWS

Cron jobs are not affected by LoadBalancers in any way.

What you mean is not run cronjobs on every scaled instance but only on one?

There are several ways, depending on your setup.

ElasticBeanstalk has an option to make one instance LEADER instance.

But I would go to CloudWatch triggers. Make a trigger that will execute a job on a random healthy instance every X minutes.

markotitel left a reply on Laravel Email Verification

There should be an option for marking threads as resolved by community members.

A lot of users are just firing one question and then dissapear completely for ever.

markotitel left a reply on Low Request Per Second With Laravel, Docker, And AWS

Have you checked RDS metrics? Try the same test with smaller instance and see what you get.

13 Dec
5 months ago

markotitel left a reply on Laravel Passport, 'personal Access' And 'password Grant'

Are these used to generate access tokens for API authentication? Or are these used just for oAuth?

If I do not do passport:install on a fresh database but provide valid private/public keys, will API auth work?

12 Dec
5 months ago

markotitel started a new conversation Laravel Passport, 'personal Access' And 'password Grant'

I am building CI/CD for a project where Laravel Passport is used. From the docs

Next, you should run the passport:install command. This command will create the encryption keys needed to generate secure access tokens. In addition, the command will create "personal access" and "password grant" clients which will be used to generate access tokens:

Where are personal access and password grant stored? And how are they used?

Only thing I know is that API auth is working without these.

I generate keys without issuing passport install and deploy them as ENV vars. So I know I do not have to use passport:install at all.

11 Dec
5 months ago

markotitel left a reply on What Would You Expect From Devops On PHP Laravel Project?

Yes that is lets say "usual", I expected more "elaborate" answer. CI/CD, build server etc... Have you guys had experience working on such projects?

markotitel started a new conversation What Would You Expect From Devops On PHP Laravel Project?

As developers, what would you expect from a devops guy to do for you if anything?

08 Dec
5 months ago

markotitel left a reply on Help About Laravel Route

I beleive the first two routes are basically doing the "same" thing. That said the first route has precedence.

What I mean is that you are expecting some request route parameter {area}, and {category}.

These two are just wildcards. And the names inside { } does not mean anything to Laravel. Instead you are using these . So it catches the first one.

Your first two routes are basically the same thing. Here is an example of what I mean.

Route::get('{area}', '[email protected]')->name('complaint.indexByArea');
Route::get('{area}', '[email protected]')->name('complaint.indexByCategory');

This example should explain what I mean. Basically you have the same route twice pointing to diferent methods. But only the first one will be catched by Laravel.

But the third one, is acutally different because it has / .

07 Dec
5 months ago

markotitel left a reply on Auth::attempt() Always Returning False.

@SNAPEY - Hah! I would love that it is that naive, so we all have a good laugh. Please @utmsandeep test this quickly I will not sleep until it is either true or false = )

markotitel left a reply on Is Docker Good For A Real Time System?

I see docker as a personal prefference in small projects where you do not need to scale "instant".

If you want to learn and experiment test it.

Otherwise you will not gain anything using Docker.

06 Dec
5 months ago

markotitel left a reply on Auth::attempt() Always Returning False.

Both answers before @munazzil answer were suggesting the same thing. No need for same suggestion again with different code. And var_dump() which has its Laravel counterpart dd() just adds to buildup the confusion that other two answers try to resolve.

markotitel left a reply on Publish/Deploy Site - Best Practices?

A lot of ways.

If you have GIT installed on the WHM server, and if you have SHELL access to the server you can setup a CRON job which will do git pull for example.

And you should put .htaccess in gitignore that way you will not overwrite it. In the cronjob you can also add migrate --force so if you have any new migrations they will be run also.

markotitel left a reply on Deploying Laravel/Vue Project To AWS Elastic Beanstalk

If you beleive you have your questions resolved. Mark it resolved, it is easier for community to find, get help and give help.

markotitel left a reply on Deploying Laravel/Vue Project To AWS Elastic Beanstalk

What issues with DB?

migrations?

You can do php artisan:migrate --force and put that in .ebexensions.

markotitel left a reply on Auth::attempt() Always Returning False.

@MUNAZZIL - Have you read two posts above? Both of us recommend the same as you did. No use to repeat again.

And why var_dump?

05 Dec
5 months ago

markotitel left a reply on Deploying Laravel/Vue Project To AWS Elastic Beanstalk

What config do you have right now?

Do you run npm build after deployment, or you have build step before deployment.

But to try to help, you should have NPM installed on elasticbeanstalk instances. You do this using ebextensions and putting config scripts in there.

These scripts will then install NPM and or whatever else you need.

By default, ElasticBeanstalk has composer installed. And issues composer install automatically if there is composer.json and VENDOR dir is not present.

NPM is not bundled out of the box. So you'll need to install it. Or have Vue components compiled before deployment.

markotitel left a reply on Auth::attempt() Always Returning False.

Can you dd($credentials) ?

Lets see what you have there.

markotitel left a reply on Passport Oauth-keys On Multiple Hosts

@aferz29 answer should be accepted.

markotitel left a reply on Laravel And Gzip... How To?

What do you want to acomplish?

You can gzip in various ways.

You want your assets to be GZIPPED when serving webpage?

I would guess you were analyzing the website using google pagespeed or similar?

Do you have Nginx or Apache?

markotitel left a reply on Run Laravel Without Storage Permissions

How is your IIS pool setup?

To what is the web root set?