kiwo123

kiwo123

Member Since 4 Years Ago

Experience Points 17,770
Experience Level 4

2,230 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 109
Lessons
Completed
Best Reply Awards 0
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.

24 Jan
4 weeks ago

kiwo123 started a new conversation After Updating Jquery To 3.0.0 I Get The JQuery.Deferred Exception Error Cannot Read Property 'addMethod' Of Undefined TypeError: Cannot Read Property 'addMethod' Of Undefined

After installing jquery 3.0.0 I get the error Cannot read property 'addMethod' of undefined TypeError: Cannot read property 'addMethod' of undefined

I am using this with the laravel php framework. v5.5

jquery-validation version: 1.19.0

I never had this issue when I used jquery 2.3.7

kiwo123 started a new conversation What Is <script>window.laravel = {!! Json_encode(['csrfToken' => Csrf_token(),]) !!};</script> Used For In Laravel 5.5

In my laravel app I saw this in my header <script>window.laravel = {!! json_encode(['csrfToken' => csrf_token(),]) !!};</script>

But what is using "window.laravel" ? I am already using and also csrf fields in my forms

10 Dec
2 months ago

kiwo123 left a reply on What Do I Put In DevDependencies In Package.json

@globals ok thanks for clearing that to me! I will edit my package.json then

kiwo123 left a reply on What Do I Put In DevDependencies In Package.json

@GLOBALS - @globals so if I have stuff like:

window.axios = require('axios');
window.moment = require('moment');

inside bootstrap.js should I then also put axios and moment inside the devDependencies?

kiwo123 started a new conversation What Do I Put In DevDependencies In Package.json

In laravel 5.5 looking in my package.json devDependencies it looks like this:

  "devDependencies": {
    "axios": "^0.17",
    "laravel-mix": "^1.0",
    "lodash": "^4.17.4",
    "vue": "^2.5.7",
    "cross-env": "^5.1"
  },

But I thought that you should only put stuff in the "devDependencies" that you use during development. But I am using vuejs in my production app so why is it placed in devDependencies and not dependencies by default?

28 Nov
2 months ago

kiwo123 left a reply on Laravel How Much Or How Many Things Should A Queue Process

@lostdreamer_nl no they are not dependent on each other. I mostly wonder if it has any performance impact or any other pros cons beside that I can more easily check witch job failed if I keep them in seperated queues

03 Oct
4 months ago
28 Mar
10 months ago

kiwo123 started a new conversation Laravel How Much Or How Many Things Should A Queue Process

When a certain action is complete in my app I need to do a few things before I return a success to the user.

  1. Send out an email to the user
  2. Send a Notification to the user through Onesignal
  3. Insert a new item in Model1
  4. Delete an item in Model2
  5. Update an item in Model3

And I would like to queue these things and I could ofc make one queue that does all those things but what is the best practise?

I was thinking of making 3 queues.

Queue1 > Send email

Queue2 > Send notification

Queue3 > Do the insert/update/deletes on the 3 tables (total of 3 queries/operations on 3 different tables)

So is there any best practise regarding queues on how much a queue should process?

kiwo123 left a reply on Laravel Scout Temporary Disable ToSearchableArray When Doing Updates

@bobbybouwmann since I already have the Algolia search client php I could fix this by using $index->partialUpdateObject()

kiwo123 left a reply on Laravel Scout Temporary Disable ToSearchableArray When Doing Updates

@bobbybouwmann yea that would be an easy fix. But I also have stuff like this $item['category'] = $this->category->category_name; this will will make a innerjoin query on my category table in order to fetch the name, and I am making 5 more of these queries in order to fetch a certain name based on a join query. Which would result in my app doing 6 more queries which I dont need since I have the from the first time I indexed. I would much rather just update the specific field and push that to Algolia

27 Mar
10 months ago

kiwo123 started a new conversation Laravel Scout Temporary Disable ToSearchableArray When Doing Updates

is it possible to disable toSearchableArray when doing updates to a record or is there any way to only update specific fields in a record in my search index?

Eg:

public function toSearchableArray()
{
          $item = $this->toArray();
        $item['title'] = $this->title;
         ...
         ...
         ...
         $item['category'] = $this->category->category_name;
         $item['uploaded_at'] = Carbon::now('America/Montreal')->timestamp;
}

The only problem now is each time I update a record it also resets its uploaded_at timestamp and re-loads the relationship which is one more query I dont need since it already has it set when I created the item.

So is there any way I can temporary disable toSearchableArray ? I only need to update a few fields in in the row in my index so there is no need to rerun everything in toSearchableArray

Like bellow only update the title and then update the title in my algolia index without reseting uploaded_at or loading the category relation again

$order = App\Order::find(1); $order->title = 'a new title' $order->save();

23 Jan
1 year ago

kiwo123 started a new conversation Using Laravel Insert() And Doing A Bulk Insert Doesnt Seem To Trigger A Insert With Scout Into Algolia

I am doing a bulk insert in Laravel like

\App\Example::insert([
    [
        'name' => 'abc',
        'value' => '123',
    ],
    [
        'name' => 'def',
        'value' => '456',
    ],
    // etc...
]);

This will do a bulk insert, one query but still inserting many rows at once.

The problem is that when I use insert() the rows doesnt get inserted to Algolia. So how can I do a bulk insert to Algolia as well?

I dont want to loop through my rows and do a insert one by once since this will cost extra requests

21 Jan
1 year ago

kiwo123 started a new conversation Convert Array Of Object Into Associative Array In Laravel

I am trying to do a bulk insert in laravel. My frontend post data to my laravel backend. The data that is posted looks like this:

rows[
0 {
  title: "my title",
  post: "my post text"
},
1 {
 title: "my title",
  post: "my post text"
},
2 {
 title: "my title",
  post: "my post text"
}
]

Now I wonder how I can make that into a associative array in laravel so it looks like this:

[['title'= >'my title','post'=>'my post text'],['title'= >'my title','post'=>'my post text']]

So it gets converted into a nameless array containing arrays with named keys

19 Jan
1 year ago

kiwo123 started a new conversation Convert Array Of Object From Vue Into Associative Array So Laravel Can Validate My Array Form Data

In order to validate an array of form inputs in laravel I need to post a associative array. But the problem is that I use vueJS which creates a "rows" object like bellow that I later post:

rows[
0 {
  title: "my title",
  post: "my post text"
},
1 {
 title: "my title",
  post: "my post text"
},
2 {
 title: "my title",
  post: "my post text"
}
]

How can I make my post data to look like this instead before I post it:

[['title'= >'my title','post'=>'my post text'],['title'= >'my title','post'=>'my post text']]

kiwo123 left a reply on Validate Array Of Objects

@bobbybouwmann the validation always passes which is weird

kiwo123 left a reply on Validate Array Of Objects

@bobbybouwmann I am using vue to post my form. I fetch all in put fields and store them into the row object like my example above, then I post the entire row object

kiwo123 left a reply on Validate Array Of Objects

@bobbybouwmann

'rows.*.title' => 'required', 'rows.*.post' => 'required',

Does not work

18 Jan
1 year ago

kiwo123 started a new conversation Validate Array Of Objects

I wonder if its possible to validate a array of objects in Laravel? I have built a form looking like a excell page using vue, so the user can edit many rows that later gets uploaded.

The data that I wish to validate when posting to my controller looks like this:

rows[
0 {
  title: "my title",
  post: "my post text"
},
1 {
 title: "my title",
  post: "my post text"
},
2 {
 title: "my title",
  post: "my post text"
}
]
15 Jan
1 year ago

kiwo123 started a new conversation Laravel Bulk Insert And With Relational One-to-one Certain Times

I know that that I can do a bulk insert like:

$data = [
    ['name' => '...', 'age' => ...],
    ['name' => '...', 'age' => ...],
    ['name' => '...', 'age' => ...],
];
Model::insert($data);

But my problem is that I need to do a bulk insert that sometimes depending on a item value can have a one-to-one relation with another table, currently I loop through my array of items that needs to be inserted and do this:

$catCheck = $request->input('category');
$newItem->insertItem($request, $userId);
$itemId = $newItem->i_id;
if ($catCheck == 8) {
     $iteminfo = new info();
     $iteminfo->insertInfo($request, $itemId);
}

When I loop through my array of items with the code above it creates multiple insert queries which I dont want since its bad for performance.

So is there any way I can do a bulk insert that has a relation in some cases?

05 Oct
1 year ago

kiwo123 started a new conversation Laravel Trans() Not Working

My directory looks like this:

``/resources
    /lang
        /en
            api.php``

api.php looks like this:

`` <?php

return [
    'couldnotlogin' => 'Login failed, please check email and password',

];``

But when I try

``trans('api.couldnotlogin');``

it will only output:

api.couldnotlogin

``dd(App::getLocale());``

returns en

other setting

``'locale' => 'en',
'fallback_locale' => 'en',``

What am I doing wrong?

31 Jul
1 year ago

kiwo123 started a new conversation Inner Join And Also Select A Specific Field From Another Table

I have the following query:

Ratings::join('users', 'movieratings.rated_by', '=', 'users.usr_id') ->where('rated_on', $movieId) ->orderBy('rated_at', 'desc') ->select('comment', 'rating', 'rated_as', 'rated_at', 'username') ->paginate(20);

This will get all the feedback ratings for a specific movie. But I have another table which contains the total good and bad ratings for a specific movie movie, the only problem is that I cant get it to work to query that table as well at the same time.

If I do another query I would simply write: Movie::where('movie_id', $movieId)->select('total_good_ratings', 'total_bad_ratings')->get(); this would output eg "22, 15" but is it possible to only fetch two columns from a specific row then do a inner join between two tables and paginate the result?

thanks

14 Jun
1 year ago

kiwo123 left a reply on [Package] Generate AWS Signature V4 - Direct Upload To S3

@kfirba Do you have any demo project including JS code that you can share? :)

kiwo123 left a reply on [Package] Generate AWS Signature V4 - Direct Upload To S3

Exactly what I was looking for, thanks!

31 May
1 year ago
30 May
1 year ago

kiwo123 left a reply on Redirect To Previous Dynamic Page After Login

@Cronix I tried that return redirect()->intended('item'); but it just redirected me to "/" I dont know if that work since I have a dynamic url like this "item/{id}"

I got it working using session like this:

public function showLoginForm() { $previous_url = Session::get('_previous.url'); $ref = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $ref = rtrim($ref, '/'); if ($previous_url != url('login')) { Session::put('referrer', $ref); if ($previous_url == $ref) { Session::put('url.intended', $ref); } } return view('auth.login'); }

``public function loginUser(ApiAuthUserPassRequest $request) { if ($request->has('rememberme')) { $remember = $request->input('rememberme'); } else { $remember = false; } $credentials = ['email' => $request->input('email'), 'password' => $request->input('password')]; if (Auth::attempt($credentials,$remember)) { if (Session::has('referrer')) { return redirect()->intended(Session::pull('referrer')); } else { return redirect('/account'); } } else { return redirect()->back()->withErrors([trans('api.couldnotlogin')]); }

}``

kiwo123 started a new conversation Redirect To Previous Dynamic Page After Login

I wonder how I can redirect a user after login?

Lets say that I am on the page "www.mysite.com/users/2" Then I try to edit a blog post without being logged in and get sent to the login page, efter login I wish to return to "www.mysite.com/users/2"

I have tried this so far:

if (Auth::attempt($credentials,$remember)) { return redirect()->back(); } else { return redirect()->back()->withErrors([trans('api.couldnotlogin')]); }

But return redirect()->back(); will only redirect me to "www.mysite.com/"

07 May
1 year ago

kiwo123 started a new conversation Laravel 5.4 Vue Is Not Defined Error

In my webpack mix file I have set .extract(['vue',... Then

mix.autoload({ validator: ['validator', 'window.validator'], vue: ['window.Vue', 'Vue'] });

And lastly removed any Vue refrence in app.js and bootstrap.js

But now when I try to use Vue in other js files I still get the error: Uncaught ReferenceError: Vue is not defined

So how can I exctract Vue and still use it in other files like: var app = new Vue({...

05 May
1 year ago

kiwo123 started a new conversation Difference Between Url() And URL::to()

I have seen both used in different project, but what is the difference between:

{{ url('/account') }} and {{URL::to('account')}}

03 May
1 year ago

kiwo123 started a new conversation How To Handle Csrf When Using Multiple Forms On The Same Page

I wonder if there is any special way to handle csrf when having multiple forms on the same page?

Right now my page is built up like this:

In my header:

`` <script window.Laravel = {!! json_encode([ 'csrfToken' => csrf_token(), ]) !!};

``

And in on the same page I have two forms, in each form I outout {{ csrf_field() }}

So its showing twice in my page.

Everything works and I dont get a token error but is this the right way to do it?

Thanks

kiwo123 left a reply on Check Which Form Error(s) Belong To

@alenabdula yes it redirects with errors and shows them I can display them using:

@if (count($errors) > 0) show errors.. @endif

But I still dont know which form it belongs to I only see the errors

kiwo123 started a new conversation Compressing Javascript Using Mix.scripts(); Removes Function From Compressed File

I am compressing a js file like this:

mix.scripts('resources/assets/js/pages/login.js', 'public/js/login.js');

My pre-compressed file contains this function:

function zoomInForm() { $('#login-page').toggleClass('zoom animated'); ........ ........ }

But in my compressed file the function zoomInForm is removed so I can never call the zoomInForm(); function on my page.

How can I just compress a js file to one line without removing functions?

kiwo123 left a reply on Check Which Form Error(s) Belong To

@alenabdula I am using that but it still redirects back and reload the page:

NewUserRequest:

``public function authorize() { return true; }

public function rules()
{
    return [
    'username' => 'required|string|alpha_dash|min:2|max:30|unique:vend_users,username',
    'email' => 'required|email|max:255|unique:vend_users,email',
    'password' => 'required|string|min:6',
  ];
}``

kiwo123 started a new conversation Check Which Form Error(s) Belong To

I wonder if there is any way I can check which form my error(s) belong to?

At the page /login a login form is displayed, but the user can also click on a register button which will toggle a jquery animation hiding the login form then showing the registration form. - So I have both login and registration on the same page.

The only problem is if I try to register and fail the validation the page will reload with the errors and showing them inside a div, but the page loads with the login form displayed and the registration form hidden which looks odd coz then you have to click on the register button again to show the register form.

So is there any way to check which form the errors belongs to so i can fire a jquery function to show the register form when the page loads?

Or even better, can I redirect to a new page with the registation form shown from start when I get a validation error?

My controller code for register:

public function createUser(NewUserRequest $request) ..... return redirect('/');

02 May
1 year ago

kiwo123 started a new conversation How To Use Packages Installed With Npm In Mix?

I wonder how I can use a package installed with NPM in mix? I have run npm install jquery-validation

Then in my bootstrap.js file I have added: require('jquery-validation'); and in app.js: require('./bootstrap');

My mix file: mix.js('resources/assets/js/app.js', 'public/js') .extract(['lodash', 'vue', 'axios', 'jquery-validation']); mix.sass('resources/assets/sass/app.scss', 'public/css'); mix.scripts([ 'resources/assets/js/libs/vals.js', 'resources/assets/js/libs/rules.js' ], 'public/js/libs.js');

But I get the error: Uncaught TypeError: Cannot read property 'addMethod' of undefined in libs.js

this is the code:

$(document).ready(function() { $.validator.addMethod("nowhitespace", function(value, element) { return this.optional(element) || /^\S+$/i.test(value); }, "No white space please"); });

But why is addMethod undefined when I have added require('jquery-validation'); in my bootstrap.js file?

Also since I am using jquerys cdn I have removed in from my bootstrap.js and webpack config:

new webpack.ProvidePlugin(Mix.autoload || { //jQuery: 'jquery', //$: 'jquery', //jquery: 'jquery' }),

kiwo123 started a new conversation How To Use A JS Packages Installed With Npm In Laravel Mix

I wonder how I can use a package installed with NPM in mix? I have run npm install jquery-validation

Then in my bootstrap.js file I have added: require('jquery-validation'); and in app.js: require('./bootstrap');

My mix file: `` mix.js('resources/assets/js/app.js', 'public/js') .extract(['lodash', 'vue', 'axios', 'jquery-validation']);

mix.sass('resources/assets/sass/app.scss', 'public/css');

mix.scripts([ 'resources/assets/js/libs/vals.js', 'resources/assets/js/libs/rules.js' ], 'public/js/libs.js'); ``

Then I use my files like this: ``

window.jQuery || document.write('') ``

But I get the error: Uncaught TypeError: Cannot read property 'addMethod' of undefined in libs.js

this is the code:

$(document).ready(function() { $.validator.addMethod("nowhitespace", function(value, element) { return this.optional(element) || /^\S+$/i.test(value); }, "No white space please"); });

But why is addMethod undefined when I have added require('jquery-validation'); in my bootstrap.js file?

kiwo123 started a new conversation Mix Version() Cant Handle Specific Files

I understand that version(); will version all files + any that gets passed in as an array. The only problem is if I do a small change in my css file I cant do any cache busting on that file alone, version(); will generate a new id for all my files.

Is this something that will be fixed in the future? I dont see why my users must re-download and cache all files again just becasue one file has been because.

Thanks,

29 Apr
1 year ago

kiwo123 started a new conversation Cant Version Specific File In Mix

I am trying to version a specific file.

mix.js('resources/assets/js/app.js', 'public/js') .sass('resources/assets/sass/app.scss', 'public/css') .babel([ 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js' ], 'public/js/libs.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/xxxx.js') .version([ 'public/js/app.js' ]);

I am trying to version app.js but I get the error: Error: ENOENT: no such file or directory, open 'public/js/app.js'

I have also tried: app.*.js

kiwo123 started a new conversation Laravel Mix Version A Specific File

I am trying to version a specific file.

mix.js('resources/assets/js/app.js', 'public/js') .sass('resources/assets/sass/app.scss', 'public/css') .babel([ 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js' ], 'public/js/libs.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/accountpage.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/accountsettingspage.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/itempage.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/messagespage.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/mylistingspage.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/ratingspage.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/searchpage.js') .scripts('resources/assets/js/pages/xxxx.js', 'public/js/soldwonpage.js') .version([ 'public/js/app.js' ]);

I am trying to version app.js but I get the error: Error: ENOENT: no such file or directory, open 'public/js/app.js'

I have also tried: app.*.js

28 Apr
1 year ago

kiwo123 left a reply on Laravel Mix Put Everything Inside App.js

@jbloomstrom how does that work with .version(); ?

kiwo123 started a new conversation Laravel Mix Put All Js Code Inside App.js

I wonder if its possible to put everything inside the app.js file? I have a lot of files that I wont touch for a long time so I dont need to worrie about cache.

Right now I am doing this in my webpack.mix.js: mix.js('resources/assets/js/app.js', 'public/js') .sass('resources/assets/sass/app.scss', 'public/css') .scripts([ 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js' ], 'public/js/all.js');

This will make two JS files: app.js and all.js. What I now want to do is to combine those files into one big file app.js. Is this possible with?:

mix.babel(['app.js', 'all.js'], 'app.js'); ?

kiwo123 started a new conversation Laravel Mix Put Everything Inside App.js

I wonder if its possible to put everything inside the app.js file? I have a lot of files that I wont touch for a long time so I dont need to worrie about cache.

Right now I am doing this in my webpack.mix.js: mix.js('resources/assets/js/app.js', 'public/js') .sass('resources/assets/sass/app.scss', 'public/css') .scripts([ 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js', 'resources/assets/js/libs/xxxx.js' ], 'public/js/all.js');

This will make two JS files: app.js and all.js. What I now want to do is to combine those files into one big file app.js. Is this possible with?:

mix.babel(['app.js', 'all.js'], 'app.js'); ?

13 Apr
1 year ago

kiwo123 started a new conversation Help Pushing Jobs Into Different Queue With Low Priority

Right now I am using Beanstalkd and Laravel forge for my queues which I fire like this: dispatch(new ProcessPodcast($podcast));

But how do I push a queue into a different job that has a low priority? This will only push the queue into a different job but not set the priority: $job = (new ProcessPodcast($podcast))->onQueue('processing'); dispatch($job);

And if a queue job has a low priority does it mean that it will be fired later when there arent that many queues or how does low priority jobs work?

05 Apr
1 year ago

kiwo123 started a new conversation Validate Data Coming From My Own Application And Database

In a function in my controller I call this:

$item = Item::where('i_id', $Id)->where('type', 1)->first();

$firebaseData = app('firebase')->getDatabase()->getReference('items/'.$Id)->getSnapshot()->getValue();

Then I do a lot of "validation" between the data from the two sources above like:

if ($item->time_expires < strtotime(Carbon::now()) && $firebaseData['active'] == 1) { return response()->json(['errors' => [trans('api.pleaserenew')]], 422); }

And since this is not data coming from a user/request I cant use Laravels validate method

I dont want to keep this kind of logic inside my controller but where should I put it? Since part of my data is coming from Firebase I cant setup a Eloquent model to handle it either.

kiwo123 started a new conversation Help Move Logic Out From Controller

In a function in my controller I call this:

$item = Item::where('auc_id', $Id)->where('type', 1)->first(); $firebaseData = app('firebase')->getDatabase()->getReference('items/'.$Id)->getSnapshot()->getValue();

Then I do a lot of "validation" between the data from the two sources above like:

if ($item->time_expires < strtotime(Carbon::now()) && $firebaseData['active'] == 1) { return response()->json(['errors' => [trans('api.pleaserenew')]], 422); } etc etc.. I feel that this kind of stuff should not be in my controller but I am not sure where I should place it?

01 Apr
1 year ago

kiwo123 started a new conversation Help Pushing Jobs Into Different Queue With Low Priority

Right now I am using Beanstalkd and Laravel forge for my queues which I fire like this: dispatch(new ProcessPodcast($podcast));

But how do I push a queue into a different job that has a low priority? This will only push the queue into a different job but not set the priority: $job = (new ProcessPodcast($podcast))->onQueue('processing'); dispatch($job);

And if a queue job has a low priority does it mean that it will be fired later when there arent that many queues or how does low priority jobs work?

24 Mar
1 year ago

kiwo123 left a reply on How Does Webpack Work On Prod Server

@Nash thanks! But if I already have runned the npm install command, is there then any way to add it afterwards to the package.json?

I never saw a version when I runned the command so I dont know what to write when adding it manually

kiwo123 started a new conversation How Does Webpack Work On Prod Server

My gitignore looks like this: /node_modules /public/storage /public/hot /storage/*.key /vendor /.idea Homestead.json Homestead.yaml .env And in my package.json file I have removed bootstrap from devDependencies and instead I use Materializecss which I install by doing: npm install materialize-css - So what do I specify in devDependencies instead?

Does that mean when I later push my code to my prod server do I have to run npm install materialize-css or does simply calling npm install do it?

22 Mar
1 year ago

kiwo123 started a new conversation What SSL TSL Version Does Laravel Valet Use?

When enabling SSL in Laravel Valet, what TSL version is Valet using?