jekinney

jekinney

Member Since 4 Years Ago

Experience Points 216,625
Experience
Level
Lessons Completed 294
Lessons
Completed
Best Reply Awards 224
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.

22 Jan
23 hours ago

jekinney left a reply on Track Bounces With Laravel Mailer

@moprocto as @snapey stated. Your mail provider generally has this data. Usually, when you send an email you get some type of id back along with a processing code. I have seen the use of webhooks that will trigger when a response to set by the mail provider so you don't have to constantly check (hit the api requesting status code till you get a code you want to process).

In other words, check to docs with the provider you are using. If you are using some other (on-prem service) need to get with the server admin.

21 Jan
1 day ago

jekinney left a reply on Laravel App For Web And Api

Resources too. Helps maintain your allowed data via ajax (think fractal)

jekinney left a reply on Lumens Tutorials?

@zabius Actually that is arguable. As it's intended for microservices (not auth etc built in) and laravel has api resources (think fractal but better) now etc. Most people, including Tayler, recommend full laravel except for small services. I personally use to use Lumen a lot for microservices within my servers (like in a VM or docker with limited resources) but nowadays with AWS and Azure (etc) offering microservers within your main server generally for free, no reason to anymore for me and my clients. Though still use cases.

More to the point, all laravel and PHP works except for routes have some limitations.

17 Jan
5 days ago

jekinney left a reply on Laravel 5.6 - How To Authenticate API Using Sessions For Same Folder SPA?

@wonka That is not how it is supposed to work at all. When you refresh the page you lose all your data that javascript is using. If your front end is all javascript use api authentication. Which case if you are using auth:api you have access to auth()->user() in the backend. But you still need to set up storing the token (and other data) on the session for your javascript app. literally thousands of tutorials for this.

Here is a basic for backend:

https://medium.com/modulr/create-api-authentication-with-passport-of-laravel-5-6-1dc2d400a7f

I believe Jeffrey has a vue one for the frontend, even with React, the premise is the same.

10 Jan
1 week ago

jekinney left a reply on Laravel Mix Minify But Copy Un-minified Version

mix.js('resources/js/app.js', 'public/js')

The default already copies the file into the public folder as app.js.

So makes sense then:

mix.js('resources/assets/js/dropzone.js', 'public/js')

would create a dropzone.js file in public for you. Rest is really irrelevant if you minify on deploy anyways.

jekinney left a reply on Limit Attendance Records Just One Per Day

As @hfalucas stated should do the trick. In your loop check if the latest date is equal to the date your putting in. If it does handle the "exception" as your requirements are to handle it.

If your requirements are just don't update then you can use a more efficient query by getting users that do NOT have attendance today or the like.

26 Nov
1 month ago

jekinney left a reply on Eloquent Relationships With Multiple Models.

Reports:

If the reports are timed (scheduled) I would generate a report and save the data to the database. That way you have a date to start the next report (last reports ending timestamp) to keep adding to your data in new reports. Limits the look up and reduces load etc.

Stream: Pretty common stuff and you probably really are overthinking it. Just get a count and or use dates for time period counts. Depending on traffic load, this is definitely a use case for qued events or jobs to fire when a user does something with a stream. Mater of fact Jeffery has a video here about using jsvideo player that has some logging ideas. Personally, I have had the opportunity to log and track videos from users too along with reports. What I ended up doing was tracking like you are but also has a log where is tracked a user's actions (stop, fast forward, paused, finished etc) via api triggers. Each request raised event and went through listeners do each listener logged the event properly (about 10 ish? listeners). The last listener dealt with updating stats on a video. The video table had stat columns like views, unique views, finishes, pauses, etc. to easily calculate states without grabbing 1,000,000,000 of rows. From my experience generating live stats will melt your database and isn't cost-effective, but rolling stats where you have some type of summary and adding or subtracting is the way to go.

Most, all I have worked on, e-commerce and inventory system has a summary table that has in-stock, sold and pending (not always pending) quality counts even if in-stock is different prices and suppliers etc, instead of calculating in-stock numbers on the fly which can be expensive if you have many stores with a POS (point of sale software) that is constantly updating or e-commerce that is updating the quantities constantly. Plus send out low-stock alerts etc.

I'm never afraid to add tables for reports and stats as needed, generally better performance in the long run and no need to add later.

01 Nov
2 months ago

jekinney left a reply on Laravel-5.6 Error: Creating Default Object From Empty Value

$request->validate([
    'tag' => 'required',
]);

jekinney left a reply on How Do You Properly Check If A Record Exists?

Add to @click post:

Profile::where('propertyid', '=', $propertyid)->first();

Returns null if nothing is found, as mentioned you have a few "laravel" methods available.

$profile = Profile::where('propertyid', '=', $propertyid)->first();

if ( $profile->isEmpty() ) {

}

// or 

if ( $profile->isNotEmpty() ) {

}

https://laravel.com/api/5.7/Illuminate/Support/Collection.html#method_isEmpty

11 Oct
3 months ago

jekinney left a reply on Laravel And Vue - Web / Auth Middleware Is Pushing Out My Users Randomly.

Hard to describe without a picture... lol

SO each api call to laravel should be validated serverside and only server side.

Any route request using Vue router, validation should be validated with Vue.

So each handles its own validation. For example a basic show page you validate via before routing in Vue. Then allow access to the page. If the page requires a user to be logged in, verify the token in the session storage (or vuex method) and expiration isn't expired of the token.

As the page loads, if an api calls are sent, they will be validated by laravel. So if the api requires the user to be logged in, you must have the authorization header with the token. Otherwise, you will get errors and the user isn't authenticated.

What I see and have done in the past is rely on one validation\auth and not both which leads to bugs. Also setting the token to be saved and proper recovery for each request to set the header (70% of the time that is the issue). Lastly not paying attention to the expiration timestamp of the token, obviously after it's expired your user is "kicked" out.

To solve the above issues I set up my before route file in Vue to check my vuex getter for the token and expiration. If empty, look in session data and run the vuex mutation to set it again (page refresh will clear it out of vuex). Then check expiration, if close to expiration (within an hour for example) close to expired I run an api call in the background to get a new token and update the session data and set the new data in vuex. Obviously, keep validation and auth separated where they need to be and have had very few issues.

jekinney left a reply on Querybuilder Result Using ->first() Can't Be Used...

You're not showing enough code. The above should work, but very redundant. Something you are doing after assigning the name to abc variable is causing an issue.

Also, wrap your code in three backticks.

Code here

jekinney left a reply on How To Solve Problems Of Deleting From Orders Or Products

use

 'qty' => 'required|between:0,255',
// or

 'qty' => 'required|min:0|max:255',

Your not performing really any checks on your queried data, that you still will need to do to be sure of the quantity available etc. But the validation of negative numbers is above.

jekinney left a reply on Integrating Facebook Page_insights With Laravel

Set up models for a set of api calls ( set mean same data ). A model's data doesn't have to be a database, it can be from anywhere.

Learn some guzzle calls etc to get the data from the api urls. You may want to wrap each call in a function, I generally try to simulate Eloquent functions for consistency.

Than rest should be the same as any other data model in laravel.

Facebook docs are amazing and might have php sdk already, which might make it easier (sometimes).

jekinney left a reply on How To Make S3 Images For Google Page Speed Friendly

???? Your question is very generic.

What are you really trying to do? Maximum speed is use a CDN and not s3.

Also assuming your setting your cache headers correctly as to reduce requests and use cached image files (default checks every refresh, but should be set to not check for x-amount of minutes).

Also assuming your images are sized correctly and in your img tag you set proper src for the browser size to call the correct url for the default size.

jekinney left a reply on Passing Post Id And User Id To The Create Controller When Someone Create A Comment

Few ways, I'll address it as basic as possible:

If you are using an API and using the auth:api middleware you have access to the authenticated user:

auth()->user() // full user model

auth()->id() // obviously just the id

Another option (not recommended as it can be changed) is to add the user id to a hidden input. This will need to be validated by auth() and request exists validation.

Post id you can pass in as a URL param

?post_id=1

Or a hidden input field (generally used), once again need to use exists validation.

I also strongly suggest for maximum security balance is use uid's or uuid's instead of id's. This just keeps the average person from guessing a private or a post that they aren't suppose to have access too. Might be overkill depending on usage.

10 Oct
3 months ago

jekinney left a reply on Named Route With Multiple Parameters

Either way, you still ran out of memory. So either you have a loop never ending somewhere or a crazy query. Either way, your question answers its self with what you have provided.

Your route isn't the issue, some code executed somewhere is the issue. DD is your best friend

jekinney left a reply on Laravel And Vue - Web / Auth Middleware Is Pushing Out My Users Randomly.

Vue should be taking care of authentication for routes. Any API calls then you set the auth header and should be good.

If you are trying to authenticate both Vue routes and API routes server side and our setting your self up for crazy bugs. With Vue you should be checking every route request if your session is set (or vuex or another method) locally only. Then when they send a request, for example, create some data, then you make sure auth header is set with the token and send your request.

99% sure your header isn't set correctly

jekinney left a reply on ID Does Not Pass From View To Controller

People still use form helpers?

Store method with route model binding? Should be update right?

Did you:

public function store(Contact $contact, Request $request)
    {
    dd( $contact);
    }

If null or empty then your route is written wrong.

Also check out the default update method, and notice anything different?

public function update(Request $request, Model $model)

The order may not have anything to do with it?

jekinney left a reply on Consuming Your API With JavaScript - Issue

@partabsaifzakir

You obviously skipped a step somewhere.

If you are using postman, if you are hitting the middleware and not authenticated you should be getting an 501 code.

For first code section, you put middleware in web, you should be in API.

Check your config/auth and set to passport?

If all else fails try

 Route::prefix('blog')->namespace('Blog')->group( function () {

    Route::prefix('category')->group( function() {
        Route::get('/list/full', '[email protected]')->middleware(['auth:api', 'permission:blog-categories,blog-articles']);

using the middleware in your API routes file (notice the array syntax) don' t worry about permissions that is a custome middleware on app I am working on now).

jekinney left a reply on Consuming Your API With JavaScript - Issue

Check out this tutorial. If you like it I suggest bookmarking it. Will work with 5.7 btw.

https://medium.com/modulr/create-api-authentication-with-passport-of-laravel-5-6-1dc2d400a7f

jekinney left a reply on Saving An Array Into A JSON Column In A MySQL Database

@D9705996

You have a valid point and good catch, I was trying to be quick, but you can inject PHP in javascript though not recommended (use props or data attribute etc.)

JSON.parse( {{ $test->body }} )

jekinney left a reply on Laravel Form Build Json.

That is an extremely generic question. You have any experience with JSON or what have you tried. All you need to do is utilize PHP to encode and decode (which will stringify or set as an array) but you may want JSON to the frontend and let javascript parse the JSON?

Try to be more specific, hard to find someone to do your work for you and google shows a butt load of tutorials.

jekinney left a reply on How Does "retry_after" Actually Work?

Over on the laravel docs under prologue, you have API documentation.

This will list all the classes and functions etc.

https://laravel.com/api/5.7/Illuminate/Queue/Console/RetryCommand.html#method_retryJob

So if you look at the right side, very tiny "at line68" is a link to the source code on github.

https://github.com/laravel/framework/blob/5.7/src/Illuminate/Queue/Console/RetryCommand.php#L68

Obviously, you need to also track down the called functions too.

jekinney left a reply on Cron Tasks Backend/Frontend Setup

CRON is not a windows program but a Unix and Linux program.

Here is the first thing I found using the google machine: https://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron

Windows does have a scheduler program but usually requires user interaction to set up (permissions etc) via its gui.

Good luck!!!!!

jekinney left a reply on Saving An Array Into A JSON Column In A MySQL Database

First what you have in your example is (artisan command) is a string version of JSON.

This test was run in Postman as a post request with no special headers and a payload (body) of:

{
    "body": {
            "tasks" : [
                {
                        "task" : "Direct or coordinate an organization's financial or budget                activities to fund operations, maximize investments, or increase efficiency."
                },
                {
                        "task" : "Confer with board members, organization officials, or staff members to discuss issues, coordinate activities, or resolve problems."
                }
            ]
    }
}

So if you do this:

Route::post('/', function (Request $request) {

    $test = Test::create([
        'body' => json_encode( $request->body )
    ]);

    return response()->json($test->body);
});

Your response will look like:


"{\"tasks\":[{\"task\":\"Direct or coordinate an organization's financial or budget activities to fund operations, maximize investments, or increase efficiency.\"},{\"task\":\"Confer with board members, organization officials, or staff members to discuss issues, coordinate activities, or resolve problems.\"}]}"

Which is what you don't want.

On the other hand:

Route::post('/', function (Request $request) {

    $test = Test::create([
        'body' => json_encode( $request->body )
    ]);

    return $test->body;
});

Returns:

{"tasks":[{"task":"Direct or coordinate an organization's financial or budget activities to fund operations, maximize investments, or increase efficiency."},{"task":"Confer with board members, organization officials, or staff members to discuss issues, coordinate activities, or resolve problems."}]}

which is what you are looking for.

Issues to look for:

By default, laravel responds with JSON data if you return data not put into a view. So you (as above) need to ensure it is sent as JSON not a string version of JSON.

Notice I insert as json_encode(). If not the Illuminate\Http\Request sets JSON as an array:

array:1 [
  "tasks" => array:2 [
    0 => array:1 [
      "task" => "Direct or coordinate an organization's financial or budget activities to fund operations, maximize investments, or increase efficiency."
    ]
    1 => array:1 [
      "task" => "Confer with board members, organization officials, or staff members to discuss issues, coordinate activities, or resolve problems."
    ]
  ]
]

But if I json_encode() looks like:

"{"tasks":[{"task":"Direct or coordinate an organization's financial or budget activities to fund operations, maximize investments, or increase efficiency."},{"task":"Confer with board members, organization officials, or staff members to discuss issues, coordinate activities, or resolve problems."}]}"

Which is a stringified version.

Like above, don't be afraid to create a new Laravel project just to play around. Took me less than 5 minutes to play as above.

End of the day, you are fighting defaults from laravel. I assume you're newer at Laravel as you not using Eloquent. Don't be afraid to look at source code. Taylor left a lot of comments to explain a lot.

jekinney left a reply on Phpunit Testing Form Validation

Validation returns status code 422 with message bag. You can simply assert you get a status code of 422. To further dig down you can assert you see the specific error message, though the validation is assumed to work as it is tested as part of the framework.

Example: You may test you create a new model instance and return proper data. but you usually don't test Eloquents create method.

So @Tray2 stated you generally test the happy path. Maybe a few bug type tests if a user does something weird, but that is generally end to end testing via open browser, have it fill out form etc.

28 Aug
4 months ago

jekinney left a reply on Laravel Update Without Passing ID

On your create method (assuming ajax) return the data and add the id to your javascript data.

What your doing is common as the timestamps are important to be accurate. You can also use UpdateOrCreate (a few others too).

jekinney left a reply on Add Multiple Rows While Migration

What I do in this type of situation is create my own command via make:command. In the command call your migration and applicable seeders.

That way you call a single command with an expressive name. IE: refresh:withCarsData

23 Jul
6 months ago

jekinney left a reply on What Is A Right Way To Authenticate SPA JavaScript Application? (API)

Usually you have two types of authentication on a spa.

Application its self (domain to domain) User

Application (CORS) can be authenticated on the api server. Generally required now.

User is generally password grant (or JWT, same premise and structure). You can configure them to be extremely strict and "safe" but sacrifice performance as each request requires multiple checks, data transfers and hashing/un-hashing.

Other types are used in different circumstances etc. You generally only keep secret keys server side. So server to server requests.

22 Jul
6 months ago

jekinney left a reply on Form Request Refreshing Page

You are failing your permission validation, you don't see it because your not displaying errors on your page.

Your checkbox is wrong, each check box requires a value to pass into permissions[]. HTML 101.

Secondly, if your new, test NOT using a formRequest class and do validation off the $request class ($request->validate([]): and use dd() to check your data etc.

Test by Injecting Request instead of RoleRequest and

dd( $request->permissions);

Bet it will be null or [].

jekinney left a reply on Select Multiple Values For Column

Your question and error message are two different issues.

As far as the error you need to look over the paginate function in the docs. Keep in mind your using the query builder for some reason.

25 May
7 months ago

jekinney left a reply on Getting Monthly Sum For Specific Year

@randi I have not used vue charts as of yet.

28 Apr
8 months ago

jekinney left a reply on How To Remove Extra Fields While Returning Date

Look at the carbon docs to format the date as needed. Common ones are ->diffForHumons() and toDateTimeString().

04 Apr
9 months ago

jekinney left a reply on Multiple Buttons In One Form Fires All Methods

@Nash has the correct answer IMO.

jekinney left a reply on Sending Emails To A User That Isn't Logged In

@stargatesg1 Obviously your are entitled to your opinion, but compared to even just a few years ago email in laravel is stupid simple if you not only read the docs, but understand how stuff works. If you can't get email to work in laravel, good luck with old PHP and/or swift mailer package,

On-Demand Notifications
Sometimes you may need to send a notification to someone who is not stored as a "user" of your application. Using the Notification::route method, you may specify ad-hoc notification routing information before sending the notification:

Notification::route('mail', '[email protected]')
            ->route('nexmo', '5555555555')
            ->notify(new InvoicePaid($invoice));

https://laravel.com/docs/5.6/notifications#on-demand-notifications

07 Dec
1 year ago

jekinney left a reply on How To Use Left Join In Eloquent

@w1n78 WOW, 2 years old..

The has() method will not return a Shoe object (in your case) if it doesn't have a image. So it still works as intended. Looks like your case you want the Shoe no matter what. So different use case.

20 Nov
1 year ago

jekinney left a reply on Use Timestamp As Primary Key

@jaheller

Time stamps are strings, Laravel expects integers by default.

  protected $primaryKey = 'uid';
    
    protected $casts = [
        'uid' => 'string',
    ];

Obviously the above is for a uid not ID, but concept is the same.

jekinney left a reply on ERR_TOO_MANY_REDIRECTS In My Laravel

Usually means you have a redirect loop.

If you redirect a non-authenticated user to a route that requires authentication will trigger that error (for example).

jekinney left a reply on How To Update Json Field In A List Of Items

@strejo @cbh

Create a text column (or medium text etc). use php to json_encode() the data.

this puts the data as a json string, which the db will take. When you parse it out you can json_decode into a php array or pass it to your javascript and parse it there.

$cert->create(['settings' => json_encode( $request->settings )]);
16 Oct
1 year ago

jekinney left a reply on This.$nextTick Not Working The Way Expected

I tend to lean as @wilkeglobal stated or use a computed property. The nextick will run faster (obviously) then setting data.

Another way is to use Promise.resolve() in your then(). and trigger the function else where.

PageSetUp() {
    this.getRegions().then(response => {
        // check if response etc. will not process until get regions returns data.
    });
},
getRegions() {

    let countryId = this.form.country_id;

    if (countryId) {
        axios.get('/getRegion/' + countryId)
            .then(response => {
                this.regions = response.data;

                Promise.resolve(response.data) // Promise here, 
            })
            .catch(error => {
        Promise.reject();
                this.errors.push(error)
            });
    }
},

jekinney left a reply on [5.4] Queue Worker Memory Leak

Keep in mind Ubuntu (Linux in general) while idling will use a lot of memory. The OS doesn't dump data out until it needs the space. So if you are comparing Windows and Ubuntu, Ubuntu will always "look" like it's using a lot of memory, where in fact it just doesn't dump until it needs to. So you really need to "test" when your actually processing jobs.

13 Oct
1 year ago

jekinney left a reply on Migrate Existing Users To Laravel Cashier

Are you re doing the database too? Food for thought, instead of migrating (assuming you mean grab all users out of a database and insert into another) just use the table already set.

  1. run export on old db - import to new db (one for one column)

  2. use old DB

11 Sep
1 year ago

jekinney left a reply on Many Questions About Passport...

Passport is overkill for that, go with Bashy's recomendation

04 Jul
1 year ago

jekinney left a reply on Converting Join Sql Statement To Eloquent.

@tykus Honestly, no joke intended, what's the benefit of that query over the raw sql? You pretty much just wrapped in in raw().

jekinney left a reply on Converting Join Sql Statement To Eloquent.

Eloquent doesn't do joins. It breaks your query into smaller queries. In theory smaller more efficient queries. What have you tried? Translating it for you doesn't really help you learn.

I am going to assume you have the relationships set on each model. And I abbreviated the model names: WARNING NOT TESTED and may need some tweaking.

 Service::with(['messages' => function($query) => {
    $query->whereDate('scheduled_at', CURDATE());
}], 'msisdn')->get();

https://laravel.com/docs/5.4/eloquent-relationships Relashionships (also get started and basic videos here)

https://laravel.com/docs/5.4/queries#where-clauses scroll to whereDate()

https://laravel.com/docs/5.4/eloquent-relationships#constraining-eager-loads Constraining eager loading

26 Jun
1 year ago

jekinney left a reply on Laravel - Is It Possible To Learn It In A Few Weeks?

Love it!! First and foremost when someone states an opinion as a fact, I generally walk away. They show they aren't open to discussion. But hey:

Best buy, Wells Fargo, Dell (actually alienware), gamesmart (8 million users a day) to name a few bigger laravel apps (API and typical php) I've touched. Guess laravels crap cause one person can't learn it in an hour.

jekinney left a reply on Routes Does Not Work

Using _ in your urls? Uuummm.

jekinney left a reply on Saving Money In Database

This is a long standing argument. Any case php has a format money helper. In laravel I suggest a get attribute, but if you need the integer value anywhere, it may not be the best approach, and instead suggest a helper function like the docs show for a users full name.

@acorbeil integer is argued to be preferred to eliminate rounding issues. More so with currency conversions. So you definitely need a function/helper to set the integer as needed. If you live in the USA, an example is gas. A gallon of gas is always 9/10 of a cent, 2.999 due to federal tax. Obviously this is rounded to a even cent (always up in this case). If you use a float type in DB, and float type in php who's figuring the rounding up? Or just limiting so your application can set actual price? Sales taxes almost never are two decimal places, this costing someone money.

20 Jun
1 year ago

jekinney left a reply on Why We Should Mix Our All Js Files In Webpack ?

Browsers can only handle so many requests at the same time. For example: IE 9 is 4 at a time. 1 css, 1 jquery, 1 bootstrap js and 1 custom js. Cool untill you have images......

What webpack does is pack those three js files into one, but also only pull in what you are using. Theory is if you are using lodash and only importing the isEmpty method, it will only pack in that method not the whole lodash library, then minifies the code. Also takes the different script types (type script, ecma script 6 etc) and defaults it to plain old javascript.