carlosmoreira

carlosmoreira

Member Since 4 Years Ago

Miami

Experience Points 6,235
Experience Level 2

3,765 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 104
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.

11 Sep
4 days ago

carlosmoreira started a new conversation Issue Logging In When Storing Session In Database

Hello all,

I am currently working on a Laravel 5.5 project. I was tasked with changing the session from a file system to the database.

I noticed a passed developer had attempted to run through the steps and for some reason the system was never fully changed to the database for some reason.

But after following the steps on the Laravel Docs, I am getting a 401 Unauthorized error after logging in successfully.

It logs me in and redirects me to the auth protected page, but when it reaches the page it show a 401 unauthorized error.

I did notice that there is some items in the sessions table, but user_id is empty.

I've ran through the following steps:

  • The migrations are set and create.

  • The .env SESSION_Driver has been changed to database and I confirmed the session.php file is reading from the .env variable.

  • I've also cleared the laravel cache and also called "php artisan config:cache"

Also if I change the session back to use the FILE driver, everything works just fine.

Has anyone run into something like this before?

Thanks!

21 Dec
3 years ago

carlosmoreira left a reply on Switch DB Connections In Model

Perfect!

Worked exactly as described thank you!

carlosmoreira started a new conversation Switch DB Connections In Model

Hello,

Can someone tell me if it possible/how to switch DB Connections in a Model?

Example: In my .env file I have my regular connections DB_CONNECTION=* , but I also want to have a separate connection to a completely different server; DB_CON2=* .

Then somewhere In my model tell eloquent to use DB_CON2, otherwise go to the default connection.

Any help is greatly appreciated. Thank you.

16 Sep
3 years ago

carlosmoreira started a new conversation Help Writing A Query With ORM

Hello I have been struggling to write a certain query in Eloquent and wanted to see if someone could help me out.

I need to select a list of products that can either be of type x or type y and must be greater than a certain date.

This is my Raw Query that works in MsSQL:

SELECT record_id FROM orders WHERE order_date > '2015-09-16 00:00:00' AND (provider = 'X' or provider= 'Y');

In Laravel I have tried using 'Where' with 'orWhere'

But that changes the query to return anything over the date or provider x OR provider y.

Any help is greatly appreciated.

16 Jul
4 years ago

carlosmoreira left a reply on Laravel And Angular Authentication

Depends what you are going for. If I remember correctly 'Forge' is built using both Laravel and AngularJS. In an interview I remember hearing Taylor Otwell saying he didn't create Forge using Angular as a the normal Single Page application, but has a mix of both blade views and inside of those uses angular he uses AngularJS.

If that's how you are doing things, then I guess I don't see a problem, but if you are strictly separating your API Service from your front end, then the only way would be to use OAuth or JWT tokens.

carlosmoreira started a new conversation Best Way To Handle REST-full Controllers After They Already Return Views.

Hello,

Hopefully I can ask this question clearly enough.

What is the best approach to create a restful application after a currents applications routs already return views.

For example we have a Product Controller, whoms index method returns a view of all products, but now we want to have an API that only returns all the JSON data instead.

What is the best possible solution without having to create a separate controller and repeat all the logic of each CRUD command.

As always any help is greatly appreciated.

21 May
4 years ago

carlosmoreira left a reply on PDF Library

@sitesense Thank you, I will take another look now.

@stulk - Usually are servers are PHP only, We can always do an Amazon Server and install Java on it, was really hoping to avoid a route like that though. Thank you, as well I will take a look at what you sent as well.

carlosmoreira left a reply on PDF Library

@sitesense Thanks, but that parser wont either wont give me the location of where to replace something, and it wont let me replace actual text in general.

@RachidLaasri Hmm, thanks we tried to save the PDF as a docx, and the look is similar to the PDF. Is there a good library that can convert it to HTML Then to PDF or just .docx to pdf.

Thanks again for the help!

20 May
4 years ago

carlosmoreira left a reply on PDF Library

Hmm, the issue with that is that most of the PDF's are "Print Ready". Every time a change was needed, they made changes in Adobe Acrobat Pro.

They use them as templates, the issue is if they need to send them template with different information to 30 different people in one day it became very annoying and tedious to do it manually.

carlosmoreira started a new conversation PDF Library

Hello,

Would anyone know a PDF library that is capable of Replacing values in a PDF document?

I have a bunch of PDF's with multiple fields, {field1, field2, field3} and need to some how populate the fields.

I wanted to find a way I could have a PDF for example say [Field1] and it be replaced by the words I pass it.

I've done some research and just cant find something close to what I am looking for. I've landed on Zend_PDF, but for each field for every PDF I have to manually place the fields on the PDF. So if a field is 100px from left and 100px from right I have to say that explicitly in the code. Other PDF libraries are similar as well.

I have taken a look at : ZEND_PDF, MPDF, TCPDF

Any help is greatly appreciated.

19 May
4 years ago

carlosmoreira left a reply on Does JavaScript Get Better?

Lean a little bit JavaScript, then jump into Jquery to get a good understanding how DOM Manipulation works.

I believe with ECMA Script 7 releases, it will have "Classes" like other OOP languages as well.

Also I agree with @sukonovs "JavaScript : The good parts", is a bit to advanced for something starting out with JavaScript, read that when your more comfortable with the language.

25 Apr
4 years ago

carlosmoreira left a reply on Disappointed

I use windows. You can use WAMP or PHP's built in Server by running "php -s localhost:8080 -S public" inside of your Laravel app. Then hitting localhost:8080 in your browser. Please provide more details about your issue.

10 Apr
4 years ago

carlosmoreira left a reply on AJAX With L5

Try adding a fail case to the call and see what the response is.

Something like this :

.fail(function( jqXHR, textStatus ) { console.log( "Request failed: " + textStatus ); });

08 Apr
4 years ago

carlosmoreira left a reply on AJAX With L5

As mcblum mentioned above, you could use a front end framework such as angular. I believe that Taylor Otwell used a mixture of AngularJS and the laravel routing for most if his apps, such as Envoyer. If AngularJS looks like a bit to much you can look at KnockoutJS, as well.

carlosmoreira left a reply on User Set Time Based Events

Hmm, interesting, I didn't think of the date query.

But I do need it to publish at time requested by the user. Something similar to how Wordpress does it. I know Wordpress has a hook for timed events I believe, just not sure how to accomplish something like that in Laravel.

07 Apr
4 years ago

carlosmoreira started a new conversation User Set Time Based Events

Hello all,

I am trying to set something when a user dictates something should fire.

For example, we have a blog, and on the blog we want to let the content writers set a predetermined time that blog will be publish. So if the user creates a blog and sets a field in the view for that blog to be fired on a certain day, lets say that day is 5+ days from now. Then on that day and time that blog will get posted, and maybe some other events will fire as well, such as notifying Facebook for example.

I know I can use an event to check when a "New" blog is set as published then fire maybe a "post to Facebook event", but I can't figure out how that blog will be posted when the user wants.

Any help is greatly appreciated.

01 Apr
4 years ago

carlosmoreira left a reply on API With Unknown Requests

Oh!

By appending to the query object of course!

Thank you so much!

carlosmoreira started a new conversation API With Unknown Requests

Hello I'm trying to understand how to get a result of data back without knowing what the user will ask for.

Let me explain.

I have a set of locations, this set has a (name, city, state, zip-code);

I want to make an api that I can filter through what the user ask for, either through a GET or POST request.

Example:

I have a form with the fields (Name, City, Zipcode)

If the user enters text in the name field, I want to return any locations that match Name.

Now if they enter Name AND zip-code I want to return data that matches a name and the zip-code, and if they add all three I want to return data that matches all three fields.

I understand Eloquent and can easily add WHERE clauses, but I don't quite understand how I can add a WHERE clause if I don't know when one is needed.

I'm trying to avoid multiple if statements like this,

//If there is a request for name

$model = location::where('name', '>', getInput);

//if there is a request for name AND zip

$model = location::where('name', '=', getInput) ->where('zipCode'=getInput)

Etc.... Etc..

If there is a specific name for all this please let me know.

Any help is greatly appreciated.

carlosmoreira left a reply on Is It Possible To Convert Laravel Web App Into Mobile App Using Phongap?

Yes and No as well. You can use your controller to return your data as json, then from your javascript run an ajax call to where the Laravel app lies and pull data. As dberry said separate your views from your front end.

For example if you have a request to get all locations that returns a JSON set of a query.

You make an ajax call from your javascript:

$.get('//www.myapp.com/locations/all').success(function(data){ //Do something with the data inside you app });

07 Jan
4 years ago

carlosmoreira left a reply on Recommendation For Social Auth In Larvel 4

Thank you,

I'll check it out.

06 Jan
4 years ago

carlosmoreira started a new conversation Recommendation For Social Auth In Larvel 4

Can Anyone recommend me something similar to Socialite, but for laravel 4?

I have been looking at Sentry 'Social' and a another random one on Github, but has anyone used a good one in production?