marcelgsantos

marcelgsantos

Member Since 5 Years Ago

São Paulo

Experience Points 20,175
Experience Level 5

4,825 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 349
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

18 May
4 years ago

marcelgsantos left a reply on Can't Get Config Data In Lumen

@bretterer, thanks!

I forgot to run $app->configure() and, for this reason, configuration files weren't working. Now, I have other question, where should I put $app->configure()? Can I run it from base Controller?

Thanks,

Marcel dos Santos

16 May
4 years ago

marcelgsantos left a reply on Can't Get Config Data In Lumen

Hey @bretterer, thanks for reply!

I had already enabled both too. These was the first things that I did.

Marcel

15 May
4 years ago

marcelgsantos started a new conversation Can't Get Config Data In Lumen

Hello!

I'm not capable get data from config files in Lumen. What I'm doing wrong?

I'm trying to get some config data like 'app' or 'database', for example, from routes closure and controllers and nothing.

I tried to use config helper, follow documentation (http://lumen.laravel.com/docs/configuration#configuration-files) without success...

I would to use custom configuration as seen in Lumen documentation.

Thanks,

Marcel dos Santos

09 Mar
4 years ago

marcelgsantos started a new conversation API Project Organization

Hello!

I'm creating an API application that exposes some data from our internal database. This API application will exposes those data based in some contexts according to each business partner will access it. For example: a company called Acme would access entrypoint http://api.mycompany.com/acme, another company called Foobar will access entrypoint http://api.mycompany.com/foobar and so on.

As business logic will be almost the same I prefer create one application for deal with. But how I should organize this project? I imagined the following structure separating some business logic inside a folder for each company like Acme or Foobar for example and create the routes in one main routes file. Or should I use multiple routes file?

Or should I use a HMVC structure or another approach?

api-mycompany
    app
        Api
            Acme
                Exceptions
                Models
                Repositories
                Services
                ...
            Foobar
                Exceptions
                Models
                Repositories
                Services
                ...
        Http
            Controllers
            Middleware
            Requests
            Kernel.php
            routes.php

Thanks,

Marcel dos Santos

25 Feb
4 years ago

marcelgsantos left a reply on Where To Put Things In Laravel 5?

Thanks, @codeatbusiness!

I read this article and found it very good! But I have other doubts about it like following:

Is correct to put validation classes inside Services directory? And should put my custom exceptions in Exceptions folder?

PS: The reason that I'm not using FormRequest for validation is because my application is an API and I need to control the flow to send the correct data to API response.

Thanks,

Marcel dos Santos

marcelgsantos started a new conversation Where To Put Things In Laravel 5?

Hello!

I'm starting a new project in Laravel 5 and I have some doubts about where to put things...

In Laravel 4 I used to organize my application like this:

my-app
    app
        Acme
            Exceptions
            Repositories
            Services
            ...
    boostrap
    public
    vendor

In Laravel 5 I'm doing like this:

my-app
    app
        Exceptions
            MyCustomException
        Repositories
            SalesRepository
        Services
            SalesValidator
        ...
    boostrap
    config
    database
    public
    ...

It seems a good way to organize my application? My exceptions are in good locations? Is correct to put validation classes inside Services directory?

PS: The reason that I'm not using FormRequest for validation is because my application is an API and I need to control the flow to send the correct data to API response.

Thanks,

Marcel dos Santos

23 Feb
4 years ago

marcelgsantos left a reply on How An API Application In DMZ Should Access A Database With Sensitive Data In A LAN?

Hey @willvincent, I think the same way as you! ;) It will be one more app to maintain, one more point of failure and our LAN will remain accessible anyway ;)

They said that this approach is more secure because the database won't be accessible directly. And in any case of invasion the database will not be compromised.

Is there any way to redirect the database access through an intermediate server? Something like this: 'webserver' connect to 'intermediate server' (10.10.50.10:5000) and 'intermediate server' connect to 'database server' (10.10.30.18:6500)...

Thanks,

Marcel dos Santos

marcelgsantos left a reply on How An API Application In DMZ Should Access A Database With Sensitive Data In A LAN?

Hey @willvincent, thanks for reply!

I had imagined exactly this way but the network guy said that this way is insecure and that DMZ cannot access the database directly in LAN for security concerns.

He suggested create an intermediate application inside LAN to connect with the database and the application in DMZ connect with this intermediate application without touch the database. Does it make any sense?

Are there other way to do this like some kind of tunneling?

Thanks,

Marcel dos Santos

marcelgsantos started a new conversation How An API Application In DMZ Should Access A Database With Sensitive Data In A LAN?

Hello!

I'm creating an API that should be accessible from outside and will be reside in a server in DMZ. But this application should access our internal database (contains sensitive data) that is located in LAN.

For security reasons DMZ shouldn't have any acess into LAN. What should I do in this case?

LAN:

  • secure and controlled environment
  • database with sensitive data
  • not accessible from outside

DMZ:

  • insecure enviroment
  • webserver exposing an API
  • acessible from outside

Thanks,

Marcel dos Santos

09 Feb
4 years ago

marcelgsantos left a reply on Approaches To Create Some APIs

@AlnourAltegani, thanks for reply!

My problem is not about versioning my APIs. My problem is how structure different APIs under same domain and not to spend much money with SSL certificates...

Bye ;)

Marcel dos Santos

marcelgsantos left a reply on Approaches To Create Some APIs

Hey @thepsion, thanks for reply!

I think that approach 2 is the best way too. It was that I proposed to my boss as the correct way + wildcard SSL certificate.

He is complaining about the price of wildcard SSL certificates here in Brazil and maybe the price is not worth it for this project...

Do you know any reliable wildcard SSL certificate service that does not cost too expensive?

Thanks,

Marcel dos Santos

marcelgsantos left a reply on Approaches To Create Some APIs

@SP1966, thanks! My suggestions were wrong. Sorry! I updated the approaches, see them and tell me what do you think about them...

Marcel dos Santos

marcelgsantos left a reply on Approaches To Create Some APIs

Hey @SP1966, thanks for reply!

What do you think about the URL approaches? I think that approach 2 is the best way but is a little bit harder because I need to create a subdomain and SSL certificate for each API that I would like to create. And approach 1 is little bit confusing and can become a mess but is easier and I don't need to create new subdomains and SSL certificates...

Approach 1
www.mycompany.com/api1/entrypoint
www.mycompany.com/api2/entrypoint
www.mycompany.com/api3/entrypoint

Approach 2
api1.mycompany.com/entrypoint
api2.mycompany.com/entrypoint
api3.mycompany.com/entrypoint

Thanks,

Marcel dos Santos

marcelgsantos started a new conversation Approaches To Create Some APIs

Hello!

I need to create some simple APIs that will be consumed by some partner companies. As I need to create many APIs for different companies what is the best approach to create these APIs?

Approach 1
api.mycompany.com/api1/entrypoint
api.mycompany.com/api2/entrypoint
api.mycompany.com/api3/entrypoint

Approach 2
api1.acmeapi.com/entrypoint
api2.acmeapi.com/entrypoint
api3.acmeapi.com/entrypoint

Using a simple token in the request header is enough for authentication or I need something more secure? I must use HTTPS mandatory?

Thanks,

Marcel dos Santos

11 Sep
4 years ago

marcelgsantos left a reply on Deployment Approaches

Hi @ax3lst, thanks for reply!

My situation is little different from this screencast. My code is in a Git server inside my network at my job not in GitHub and I should deploy it to another server here.

Hi @thepsion5, how do you deal with assets? Do you use Grunt/Gulp?

[]s

marcelgsantos left a reply on Deployment Approaches

@keevitaja e @ruigomes, thanks for response! ;)

I use Git here and my projects are in a central repository. But my question is: a simple git clone is enough to deploy an application to a server?

I think there are many tasks that should be considered in a deployment process like:

  1. Prepare assets for production like compile, concatenate and minify CSS and JS, optimize images and copy all to public folder (I use Grunt for that)
  2. Copy the current release to /var/www/html/myapp folder
  3. Adjust some permissions like add apache user as owner of myapp directory and give some permissions to storage directory
  4. Clean some files that should not be in production but should be in version control (like Gruntfile.js, bower.json, composer.json and phpunit.xml for example)
  5. Run composer to install dependencies
  6. Run database migrations
  7. Clean and warm up cache
  8. Pointing symlink correctly to the new release

How can I deal with these tasks in the deployment process? Should I version my generated assets to get an easier deployment process? Is it a good a practice? Should I install my dependencies in production or just copy it from another machine?

Thanks ;)

marcelgsantos started a new conversation Deployment Approaches

Hello everyone!

I would like to know which tools do you use to deploy your Laravel applications? I used to use Phing to do this work when I was using CodeIgniter... Now I see another tools like Rocketeer, Capistrano and so on that seems to be better and more intuitive and opinionated.

Please, detail your deployment workflow and recipes if possible.

[]s