OneSeventeen

OneSeventeen

Member Since 3 Years Ago

Experience Points
12,150
Total
Experience

2,850 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
114
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.

Level 3
12,150 XP
Jan
22
1 day ago
Activity icon

Started a new Conversation Guests Not Redirected To Login After Defining Gates

I've started using Gates to verify if someone has permission to perform an action, and I'm chaining the "can" middleware on top of my existing authentication middleware.

I'd really like it to first make sure the user is logged in, and if they aren't redirect them to log in. After having them log in, I'd like it to verify they can perform the action or access the route, etc.

I'm sure I'm just doing something in the wrong order, but I'd love to verify if the user is logged in and redirect before even attempting the gate.

Oct
19
3 months ago
Activity icon

Replied to Public Site Based On External API - Direct Or Sync With Local DB?

Thanks, it is good to hear your perspectives and experiences. I feel more comfortable about syncing data knowing others do the same.

Oct
16
3 months ago
Activity icon

Started a new Conversation Public Site Based On External API - Direct Or Sync With Local DB?

At work we have a system that has a decent API and even has a Laravel package maintained by a community member. I've used it to make a few public facing tools like a check-in system and barcode printing system, and the only Laravel schema is for user accounts.

Overall it is super quick and works fine, but I'm also missing out on all of the awesomeness of Eloquent.

Most of the data I'm reading from the database only needs to be refreshed once or twice a day, so I'm considering writing a sync tool to pull all the data I need and insert it into a relational database, but then when someone needs to write to the database I'd hit the API to submit the data, then re-pull the related data into my project.

This would reduce the number of external API hits my system needs to make, and might lighten the load of the main application, but it also adds a little bit of complexity.

Have any of you written an application primarily for interacting with a 3rd party API? If so, do you sync data and interact locally, or do you make each page load hit the external API?

Oct
04
3 months ago
Activity icon

Replied to Passing Javascript Variable To Laravel (PHP)

@nana and @ashkan90 are right, the PHP will be run first, with the results going to the visitor's browser, then after that the javascript that was sent to them will run.

You can send the variable "name" through an ajax request to a page, but then your Laravel web route will need to handle the request.

A good video I found on making ajax requests against Laravel is this one (which uses axios to make it even easier): https://laracasts.com/series/learn-vue-2-step-by-step/episodes/18

For yours, your javascript might look something like this:

var name = path.split('/').pop();
var fullPath = "{{ route('download.file', ':path')}}";
axios.get("/encrypt?value=" + name).then(response => fullPath = fullPath.replace(':path', response.data));

And your web.php routes file might look like this:

Route::get('/encrypt/{value}', function($value) {
  return Crypt::encrypt($value);
});

For me, to make axios work (I'm super new to this) I had to install Node and run "npm install" on the command line at my app root, then run "npm run watch" so it would build my .js file, then I added the <script src="/js/app.js"></script> tag into my blade template's header.

I hope that helps!

Activity icon

Replied to Tracking Who Is Logged In To A Site When Content Is Rendered On A Remote Site

Thanks, that makes a lot of sense.

I think I will likely bite the bullet and make a Wordpress plugin for auth (since 90% of the site's I'll be using these widgets on are Wordpress based) and pass a token to identify the person via the API back to my Laravel app that hosts the Vue components and API targets.

Sep
30
3 months ago
Activity icon

Started a new Conversation Tracking Who Is Logged In To A Site When Content Is Rendered On A Remote Site

I am writing "widgets" in Vue so they can be embedded on remote sites not under my control (I'm using Laravel-Cors to restrict/allow specific domains to hit the API and pull/edit data).

My hope is to allow users to log in on my site and be redirected back to the site that has the widget embedded, and have that widget know they are logged in. Then, as long as their login token hasn't expired, I'd like it to remember them each time they go back to the other site.

The overall goal is for the remote site to only need to add a small block of code that references .js and .css files on my server, as well as a div with specific ID to load the app in.

I'm not sure if that makes sense, and I may be approaching this wrong, but my hope is to allow me to develop custom widgets for clients regardless of their website (i.e. they could be hosing a static html site and include my widget to dynamically load data stored on my site).

Activity icon

Replied to Is It Possible To Ignore/change Composer Dependencies For A Specific 3rd Party Package?

For my particular instance, that isn't working (because of how many other packages are involved that depend on the new version of the same thing), but that is a great tool to have for future needs, thanks for pointing that out.

I wound up just pulling the package into a local folder and using a local path repository for that package, which meant I could change the requirements in his composer.json file to match Laravel 6.

Now that I've tested everything works, I can let the package maintainer know he can safely update his package to work with Laravel 6.

Sep
24
3 months ago
Activity icon

Replied to Is It Possible To Ignore/change Composer Dependencies For A Specific 3rd Party Package?

Awesome, Ill try that out when Im back at my dev machine tonight!

Activity icon

Started a new Conversation Is It Possible To Ignore/change Composer Dependencies For A Specific 3rd Party Package?

I'm trying to migrate to Laravel 6, but I use a 3rd party package with dependencies based on Laravel 5.8 (i.e. illuminate/container 5.x) and I'd love to change that to something that works with Laravel 6 to test and see if it really breaks anything.

In the past I've cloned the package and told Composer to use my own repo, but I'd really rather something simpler if possible. I was hoping for something I could enter in my composer.json to override the dependencies similar to using the repositories section for overriding the source for the files.

Am I missing something easier, or do I need to clone it and test changes then submit the change to the package author?

Thanks in advance!

Sep
05
4 months ago
Activity icon

Replied to Dev Workflow

I felt the same way for a few years and didn't see the value in complicating things with version control and everyone having a local copy until I read through "Understanding the GitHub flow": https://guides.github.com/introduction/flow/

Basically everyone can work from the same starting point, but can be working on different areas of the code, regularly submitting their changes as a separate branch or feature to the main code-base. After everyone agrees the code looks safe to include in the project, they can merge the feature into the core code and all the devs can pull down the update core without messing with the changes they themselves are working on.

It sounds a lot more complicated than it is, and it seems to be very successful for projects with just a few developers as well as projects with thousands of developers.

Actually, it sounds a lot like what you are looking for: a central online repository for the single source of the code. It simply adds the ability for devs to each grab a copy to work on locally (where it will be faster and they can each use their own preferred editors/tools/etc) and they can push their changes in a non-destructive way to the single online system.

Personally, after going through the tutorial I've started using the same method of development even on projects I work on alone.

The great thing is, you can use scripts to deploy what you are working on in to a staging environment and into production very easily.