ralee

ralee

Member Since 4 Years Ago

Experience Points
24,110
Total
Experience

890 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
223
Lessons
Completed
Best Reply Awards
2
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 5
24,110 XP
Jun
16
2 years ago
Activity icon

Replied to Laravel-Mix Sourcemap Files Not Genarates

Any updates on this?

Jun
14
2 years ago
Activity icon

Started a new conversation JWT Token Expiry Log Out Implementation

Hi Guys,

Can someone share their advice on how do website detect expired tokens and redirect users to the auth screen if user remains inactive for too long.

From my knowledge the two ways to implement this might be :

  1. A Javascript timer that runs a function every minute to check if expired
  2. Scheduler on the server that calls webpush to trigger a function call every minute

Is there another way to do this, please share.

Jun
11
2 years ago
Activity icon

Replied to Get File Path Of File On S3

Try this

$file = Storage::disk('s3')->url($path);
Apr
29
2 years ago
Activity icon

Started a new conversation Redis Sentinel (Need Guidance/Advice)

Hi,

I was hoping someone can share instruction/tutorial link/a simple write up on how they've managed to setup redis sentinel.

I've been reading online but i cant even get past installing it. =(

Background I am planning to setup 2 Redis/Queue Server with Digital Ocean a Queue Cluster isolated from the Application and Database layer. I've Redis installed on them, but i am pretty much clueless on the next step.

Thanks in advanced.

Apr
25
2 years ago
Activity icon

Started a new conversation Right Approach To Setup Database Cluster (Fail Over)

Hi Guys,

I am trying to find out what is the right way to setup a Database Cluster with redundancy measures.

From my research I have summarised that there are 2 ways i can go about implementing this.

  1. Load Balancer
  2. Floating IP

But I am confuse with the go about to restrict external access to the Load Balancer IP address or Floating IP Address.

From what i gathered. It is best practise to only allow internal IP address within the network.

Appreciate your guidance. Thomas

Nov
24
2 years ago
Activity icon

Replied to Safari Crashes With Webpack, Please Help

@ejdelmonico

I managed to fixed the issue, turns out to be one of the library i am using. I was calling it by the file instead of the standard require way. Guess that caused the file to be un-babelize. Thanks for helping me through.

Nov
23
2 years ago
Activity icon

Replied to Safari Crashes With Webpack, Please Help

@ejdelmonico

I did install babel globally. Followed your gulpfile syntax.

Same error persist on Safari. Its working fine on Firefox and Chrome though.

'use strict';
const elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');

 elixir((mix) => {

    // mix.copy('node_modules/font-awesome/scss/font-awesome.scss', 'public/fonts');
    // mix.copy('node_modules/font-awesome/fonts', 'public/fonts');
    
    mix.sass('app.scss')
    // .sass('landing.scss','public/css/landing.css')
    // .webpack('landing.js', 'public/js/landing.js')
    .webpack('trade.js','public/js/trade.js')
    // .webpack('setting.js','public/js/setting.js')
    // .webpack('overview.js','public/js/overview.js');
});

 Elixir.webpack.mergeConfig({
    module: {
        loaders: [{include: /\.json$/, loaders: ["json-loader"]}],
    }
});
My codes sample

//trade.js

window._ = require('lodash');
var Vue = require('vue');
import store from './vuex/trade-store'
import baseTrade from './components/trade-base.vue'

// import axios from 'axios'
// Vue.prototype.$http = axios

var vm = new Vue({
    store, 
    el: '#trade',
    render: h => h(baseTrade),
    beforeCreate(){
        store.dispatch('fetchUserConfig') .then(()=>{
            store.dispatch('initEchoChannels')
            store.dispatch('initTrade')
            store.dispatch('initTradeChannels')
        })
        store.dispatch('getTradeIDS')
        store.dispatch('fetchNotifications')

        store.dispatch('getTradeConfig').then((product) =>{
            store.dispatch('fetchProducts', {product, activeOnly:true}).then(() =>{
                store.dispatch('fetchTrade')
                store.dispatch('fetchOrders')
            })
        })

        store.dispatch('fetchCompaniesList')
        store.dispatch('registerServiceWorker')
    },
    created(){
        window.addEventListener('popstate', (e) => {
            store.dispatch('back', {arg:'trade'})
        });

        window.addEventListener("keydown", (e) => {
            if (e.keyCode == 27) 
                store.dispatch('hideAllForms')
        });
    }
})


//trade-base

<template>
  <main id="trade">
    <flash-box></flash-box>
    <app-header page="Trade"></app-header>
    <navigation page="Trade"></navigation>
    <trade></trade>
  </main>
</template>

<script>
  import appHeader from './dynamic/Header/header.vue'
  import navigation from './dynamic/navigation.vue'
  import flashBox from './dynamic/flashBox.vue'

  import trade from './trade/trade.vue'

  export default {
    name: 'tradeBase',
    components:{
      appHeader, navigation, flashBox, trade
    },
  }

</script>

Flashbox.vue

<template>
    <div class="flash" v-if="flashes.length!=0">
        <transition-group tag="div" 
        enter-active-class="animated slideInLeft"
        leave-active-class="animated slideOutLeft">
        <div class="flash_box" v-for="flash in flashes" :key="flash.id" :class="flash.class">
            <p>
                {{flash.message}}
                <i class="fa fa-times" aria-hidden="true" @click="remove(flash.id)"></i>
            </p>
        </div>
    </transition-group>
</div>
</template>

<script>
    import { mapGetters, mapMutations} from 'vuex'
    export default {
        name:'flashBox',
        computed:{
            ...mapGetters({
                flashes:'flashes'
            })
        },
        methods:{
            ...mapMutations({
                remove:'dynamic/REMOVE_FLASH'
            }),
        }
    };

</script>
//flash getters

export const flashes = state => state.flashes

Activity icon

Replied to Safari Crashes With Webpack, Please Help

@ejdelmonico

Would you be interested in remote accessing me through teamviewer? I am really grateful for the help you are giving.

Activity icon

Replied to Safari Crashes With Webpack, Please Help

@ejdelmonico

Sorry for the late reply. Internet was down. There are no errors on my gulp compiler. But on my safari is says

SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.

I also tried removing node_modules and doing a fresh npm install, still no luck. =(

Activity icon

Replied to Safari Crashes With Webpack, Please Help

@ejdelmonico,

Thank you so much for helping me. I tried what you suggested.

//Edit Gulpfile

const elixir = require('laravel-elixir');

require('laravel-elixir-vue-2');

 elixir(mix => {

    // mix.copy('node_modules/font-awesome/scss/font-awesome.scss', 'public/fonts');
    // mix.copy('node_modules/font-awesome/fonts', 'public/fonts');
    
    mix.sass('app.scss')
    // .sass('landing.scss','public/css/landing.css')
    .webpack('landing.js', 'public/js/landing.js')
    .webpack('trade.js','public/js/trade.js')
    .webpack('setting.js','public/js/setting.js')
    .webpack('overview.js','public/js/overview.js');
});

 Elixir.webpack.mergeConfig({
    module: {
        loaders: [{include: /\.json$/, loaders: ["json-loader"]}],
    }
});

//Remove Vue 1 from package.json if you are not using it. 
I removed laravel-elixir-vue
I left Vue:^2.0.1 as it is
installed buble and buble-loader globally. 

Safari Bug still persist, can you please advice on what i should do next. thank you so much

Activity icon

Replied to Safari Crashes With Webpack, Please Help

@ejdelmonico,

I installed babel-preset-es2015 and use laravel-elixir-vue-2 but my safari still crashes. Do you have any idea why?

{
  "private": true,
  "scripts": {
    "prod": "gulp --production",
    "dev": "gulp watch"
  },
  "devDependencies": {
    "babel-preset-es2015": "^6.18.0",
    "bootstrap-sass": "^3.3.7",
    "font-awesome": "^4.6.3",
    "gulp": "^3.9.1",
    "jquery": "^3.1.1",
    "json-loader": "^0.5.4",
    "laravel-elixir": "^6.0.0-9",
    "laravel-elixir-vue": "^0.1.4",
    "laravel-elixir-vue-2": "^0.2.0",
    "laravel-elixir-webpack-official": "^1.0.2",
    "lodash": "^4.14.0",
    "moment": "^2.15.2",
    "moment-timezone": "^0.5.7",
    "object-assign": "^4.1.0",
    "pickadate": "https://github.com/amsul/pickadate.js/tarball/master",
    "vue": "^2.0.1",
    "vue-loader": "^9.5.1",
    "vue-multiselect": "^2.0.0-beta.9",
    "vue-resource": "^1.0.2",
    "vuex": "^2.0.0"
  }
}

//error
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
//In detail
eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(359);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__utils__);......
Nov
21
2 years ago
Activity icon

Replied to Safari Crashes With Webpack, Please Help

@Ishatanjeeb I am using node v 7.0 I am not using JOI, dont think its going to help in my scenario.

Activity icon

Replied to Safari Crashes With Webpack, Please Help

@ishanjeeb It returns nothing

[email protected]  ~/Public/projects/helixtap   master  npm start -s

[email protected]  ~/Public/projects/helixtap   master 

Activity icon

Started a new conversation Safari Crashes With Webpack, Please Help

Hi guys,

I am having trouble with webpack, was hoping you guys can share your gulpfile or upvote the ones others are sharing.

This is mine:

const elixir = require('laravel-elixir');

require('laravel-elixir-vue');
require('laravel-elixir-webpack-official');

/*
 |--------------------------------------------------------------------------
 | Elixir Asset Management
 |--------------------------------------------------------------------------
 |
 | Elixir provides a clean, fluent API for defining some basic Gulp tasks
 | for your Laravel application. By default, we are compiling the Sass
 | file for our application, as well as publishing vendor resources.
 |
 */

 elixir(mix => {

    mix.copy('node_modules/font-awesome/scss/font-awesome.scss', 'public/fonts');
    mix.copy('node_modules/font-awesome/fonts', 'public/fonts');
    
    mix.sass('app.scss')
    .webpack('trade.js','public/js/trade.js')
    .webpack('setting.js','public/js/setting.js')
    .webpack('overview.js','public/js/overview.js');

});

 Elixir.webpack.mergeConfig({
    babel: {
        presets: ['es2015'],
        plugins: ['transform-runtime'],
    },
    module: {
        loaders:[{test:/pickadate/, loader:'imports?define=>false'}],
        loaders: [{test: /\.js$/,loader: 'babel',exclude: /node_modules/}],
        loaders: [{include: /\.json$/, loaders: ["json-loader"]}],
    }
});

I am facing issue with safari

//error
SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode.
//In detail
eval("/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils__ = __webpack_require__(359);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__utils___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__utils__);......
Nov
18
2 years ago
Activity icon

Replied to Query Json (Array) Column

Found the solution, in case someone needs them.

whereRaw("JSON_CONTAINS(user_id, '[3]' )")->get();

Activity icon

Started a new conversation Query Json (Array) Column

Hi guys,

I have a json column that stores user_id in my table design. I was planning to optimise performance this way.

So the column might look something like this

[1, 3, 5, 6, 8, 9]

//I am currently using like to query.

->where('user_id','like','%'.$id.'%');

//Thinking ahead, i believe this will cause an error
user_Id: [1, 11, 21, 31, 41]

a search for user with id of 1 will return everything.
Is there any advice on how i should write my query instead?

I hope this is clear, thanks in advanced!

Nov
09
2 years ago
Activity icon

Replied to Laravel Token Expired By Outlook On Receive

@mikevrind

Is this the one?

"Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"

I am catching that and its working, but i am worried that there are users sharing the same user agent as the one outlook is using.

Activity icon

Started a new conversation Laravel Token Expired By Outlook On Receive

Hi everyone,

I have a question with regards to auth tokens. So i have implemented an auth token for users to bypass sign in for scenarios like (password-reset) and etc.

Everything is working fine. But there is a weird bug for users using outlook.office, apparently outlook office will access these links before the users and thus expiring the token (token expires once after use) before the user access them.

I am not sure how i can distinguish between outlook.office mail server and normal users activity. Thus i cant catch the outlook office's bug. Does anyone have similar problem? Or any idea what i can do so that tokens will not be expired by outlook office?

I hope this is clear, thanks in advanced!

Oct
21
2 years ago
Activity icon

Started a new conversation Freelance Server (Autoscale)

Hi, I am wondering if anyone here have experience with autoscaling a forged Digital Ocean deployed network. My company is trying to find a experience server guy that may be interested in freelance job.

Job Description: Auto scale a Forged Deployed Digital Ocean Network. 99% Availability 3 Separate Layers: Database, Load Balancer, Application Network Communication after the Https IP should be using the server's internal ip address. Ensure Database/Redis Layer data are mirrored in the event when one of the server goes offline.

We are open to suggestions for improvements.

Oct
16
3 years ago
Activity icon

Started a new conversation Overriding Broadcast Route Response

Hi guys,

Have anyone tried pusher -> Private Channels with Laravel-Echo? I was hoping someone knows if its possible to have the /broadcast/auth route to return a json response instead of the 404 error page. Please advice.

Oct
10
3 years ago
Activity icon

Started a new conversation Laravel App Mobile Notification

Hi guys,

Quick question, has anyone set up iOS/android & Desktop Notifications with laravel Web application? The ones similar to facebook's notification. Haven got a clue on what tech are available for such setup.

The only thing i found so far is Google Push Notification. But i am not quite sure if it works with iOS. Does anyone have any clue/direction/advice for me?

Oct
05
3 years ago
Activity icon

Started a new conversation Laravel 5.3 Echo Pusher Broadcasting Not Working

Hi all,

I hope someone can help me figure out what is wrong. I am all lost here.

I tried to broadcast with laravel-echo. Here are my App\Event\SignIn codes

<?php

namespace App\Events;

use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;

class SignIn
{
    use InteractsWithSockets, SerializesModels;

    public $user;
    public $timestamp;
    public $isSecond;
    public $type;

    public $broadcastQueue = 'Notification';

    public function __construct($user, $timestamp, $isSecond)
    {
        $this->user = $user;
        $this->timestamp = $timestamp;
        $this->isSecond = $isSecond;
    }

    /**
     * Get the channels the event should broadcast on.
     *
     * @return Channel|array
     */
    public function broadcastOn()
    {
        return new PrivateChannel('user.'.$this->user->id);
    }
}

i have tried dispatching job on the Notification while listening to it. I am sure its working, so i am sure the problem aint with Redis or the Notification Queue.

But somehow running this

public function index(Request $request){
        broadcast(new SignIn(\Auth::user(), Carbon::now(), false));
        return view('index');
    } 

Isnt dispatching any jobs to my queue. Does anyone know where else i can look into?

Sep
12
3 years ago
Aug
31
3 years ago
Activity icon

Replied to Change Variable In Collection Loop

@InaniELHoussain,

Cool! I have definitely learned something useful today. Thanks!

Activity icon

Replied to Change Variable In Collection Loop

@InaniELHoussain,

Wow it worked. Thanks for the share, i will try to find links to read up on &$value.

Activity icon

Started a new conversation Change Variable In Collection Loop

Hi guys,

i tried to change the variable in the used in the loop, but it didnt reflect the change. I couldnt find anything in the documentation. Was hoping someone can point me in the right direction.

$tests = collect([1,2,3,3,4,5]);
        $value = '11111';
        $tests->each(function($test) use ($value){
            var_dump($value);
            $value = '22222';
        });
Aug
25
3 years ago
Activity icon

Started a new conversation How To Use Php :: Syntax For Custom Class

Hi guys,

Does anyone know how to use the :: syntax in classes? For example i have a test class

class test {

    public function test(){
        return 'working!';
    }
}

I tried calling it in my controller

use App\Classes\test;
class TestController extends Controller{
    public function test(){
              return test::test();
         }
}

but got Non-static method App\Classes\test::test() should not be called statically.

does everyone know the correct way of implementing this? Thanks in advanced!

Aug
22
3 years ago
Activity icon

Started a new conversation Model Static Function

Hi guys,

I am still quite unclear with model static function. I chance upon it on one of Jeffery's Lesson. This function works well.

public static function byEmail($email)
{
        return static::where('email', $email)->firstOrFail();
}

but if i add an additional where clause, it doesn't work

public static function getCompanyAdmin($company_id)
{
    return static::where('company_id',$company_id)->where('role',2)->first();
}

Can someone please explain on what model static functions are for? And how does it different from scopes?

Thanks in advanced.

Aug
11
3 years ago
Activity icon

Started a new conversation Javascript: Export A Bunch Of Import Statements

Hi,

I was wondering if its possible to export a bunch of import statements which i re-use in alot of my individual javascript files.

For example I was hoping to place this chunk of codes in a seperate file and reuse them with one import.


var Vue = require('vue');
var vueResource = require('vue-resource');
var io = require('socket.io-client');

Vue.use(vueResource);
Vue.http.headers.common['X-CSRF-TOKEN'] = document.querySelector("meta[name='csrf-token']").getAttribute('content');

import {socketRoute, redirectRoute} from './variable/mainVariables.js'
var socket = io.connect(socketRoute);

import dynamicHeader from './components/header/header.vue'
Jul
22
3 years ago
Activity icon

Started a new conversation Socket Redis With Loadbalancer

Hi Guys,

I am recently expanding my network from a standalone server to loadbalancer with multiple nodes on them. In the past i can put everything (Database, Redis, Application) all on the same server and it works fine. Coding was easy, life was easy.

But now switching over to load balancing, i have no idea where to run my socket.js script on which port. Have anyone done this before?

Please share.

Jul
20
3 years ago
Activity icon

Started a new conversation Fresh 5.2 Auth Not Working (post)

Hi Guys,

I have a fresh install of laravel 5.2 with php artisan make:auth. Migration works.

UI seems fine. But i cant register users or get error messages. I think http post isnt working.

Suspecting this to be a Https error -> Have done this on the AppServiceProvider.php

  public function boot()
    {
       if (!\App::environment('local')) {
          \URL::forceSchema('https');
      }
  }

But i am not sure if its helping. Still cant post

My laravel.log have no errors and i dont know where to look for the errors. Does anyone know what is going on?

Jul
16
3 years ago
Activity icon

Replied to How To Climb The Vue Tree Like JQuery?

@mesqueeb@gmail.com ,

i usually use console.log to debug my application. maybe you can try something like this

root.list.map(function(obj, index){
      //example 
      console.log(obj.id);
      console.log(obj.body);
      if((root.selected.id+1) == obj.id){
        root.selected = obj
      }
})
Activity icon

Replied to How To Climb The Vue Tree Like JQuery?

Hi @mesqueeb@gmail.com,

I am assuming you know how to trigger the change through a click or change event.

//maybe you can try this

root.list.map(function(obj, index){
      if((root.selected.id+1) == obj.id){
        root.selected = obj
      }
    })

I hope this brings you to the right direction.

Jul
11
3 years ago
Activity icon

Replied to SSL Setup In Forge With Loadbalancer

@dahall4,

Do you mind sharing the a general guideline/steps you took to setup load-balancer with your 4 web-servers? I have been searching online, but cant seem to find anything concrete

Jul
09
3 years ago
Activity icon

Replied to Laravel Scale Network

@gMagicScott,

Thanks for the advice. Can you elaborate alittle bit more on this => "1+ server to hold the queue (just redis) and 1+ server to do the queue work (laravel app, this will only be "listening" to the queue)"

Currently all my queues are setup through Forge QueueWorkers Interface.

Activity icon

Replied to Laravel Scale Network

@jekinney, @martinbean, @cboxdk, @fideloper Firstly I Apologise for including you guys in this post. But I saw some great replies you guys have with regards to Cluster Server. Would you guys mind sharing some advice with me with regards to this Post?

Activity icon

Replied to Laravel Scale Network

Thank you @TheNodi for sharing. I have edited my question, can you please advice if the questions do make more sense then before?

Activity icon

Started a new conversation Laravel Scale Network

Hi,

Dont really have much Sysadmin experience, but I am now face with the difficult task of scaling my application network for 2 main purpose:

  1. Failover
  2. Load Balancing

below are some questions that I hope someone can share some guidance with me on.

With some hands on: I have set up a network consisting of: (through Forge) - They're not linked at the moment.

Load-Balancer, Web-server-1, Web-server-2, Database-Server

Ideally I am trying for this setup: Image and video hosting by TinyPic

Questions:

  1. How do i configure jwt-auth to work in this setup. I understand the concept of using redis as my session driver to retain user session. Does redis has to be installed on the load-balancer? Or having it enabled through the web-app is good enough for it to work?

  2. Someone mentioned setting up stand alone servers for their queue jobs. Any idea on how i can achieve that? *Is it the right approach for my setup? Do I have to host a separate laravel application on it? I am currently using Forge interface for my queue workers.

  3. In the scenario of adding an additional Load-Balancer (through Digitalocean Floating IP), does both the Load Balancer needs share the same IP address? Assuming that users will be accessing them through the same URL (www.example.com) for example.

Please share.

Jul
07
3 years ago
Activity icon

Started a new conversation How Reliable Is Queue? [NEED ADVICE]

Hi guys,

I have a real time application which runs on redis, socket.io and laravel broadcasting. Question i have is that, there may be a scenario where multiple users click on the same button which triggers the same function at the same time. Should i queue the job? So to avoid having weird errors/outcome.

But in the scenario of queuing the request, can that lead to a long response time on the user end? What is the standard practise for such an approach. Can someone please share?

Activity icon

Started a new conversation Forge Load Balancing / Failover Setup [NEED ADVICE]

Hi guys,

I need some advice here. My knowledge on servers are to always have the database and application hosted on the same servers. But right now, i am in the mist of setting up load balancer and failover plans. Been researching on forge load balancer / digitalocean floating IP. What that confuses me is the data integrity in such a setup. What that make sense to me (Sorry i am really inexperience in this aspect) is to configure the database on a separate server on its own. So the setup should look like this.

Server 1 - Main Server
Server 2 - Backup server

Server 3 - Database server

So both server 1 and server 2 will connect to the Database server to ensure that the data are synced. Is this the right setup? Can anyone share/comment on what is the best way to go about setting up load balancing and failover.

Jun
03
3 years ago
Activity icon

Started a new conversation Security Features/vulnerabilities

Hi,

Was hoping someone here can help me out. I am always at a lost when someone/clients/non-tech bosses ask me about how secured is laravel. I can mention some of the security features such as CSRF and all. But i know that is almost impossible to build a system that is 100% secured. Can someone/anyone please share with me what are the Security features/vulnerabilities of laravel?

May
25
3 years ago
Activity icon

Started a new conversation Eloquent Order By Child Column

Hi, Does anyone know if its possible to sort result by child table field? For example I have an Orders & Company relationship. 1 Company have many orders. Is it possible to sort the data by company's name field instead of orders created_at field? Absolutely loving eloquent so if possible i would like to stick to eager loading instead of moving into join.

//This is my Query
$orders = Order::where('createdByAdmin','=',1)->companyFields()->get();
//This is my scope
public function scopeCompanyFields($query)
    {
        return $query->with(array('company'=>function($q){
            $q->select('id','name');
       // tried ->orderBy('name', 'asc'); but it doesn't work
        }));   
    }

Thanks in advanced. I hope this is clear

May
23
3 years ago
Activity icon

Started a new conversation Group Classes .php Files In A Folder On Its Own

Hi, I am trying to group my class files in a folder on its own. But doing so i need to call them each individually like this.

use App\Http\Controllers\Classes\CreateReminderCE;
use App\Http\Controllers\Classes\CreateDatelineCE;

/*
if not it will inherit the Controllers namespace like this 
App\Http\Controllers\CreateReminderCE;
when i do a use App\Http\Controllers\Classes
*/

Ultimately i was hoping that i can create another layer under Classes, like this

use App\Http\Controllers\Classes\CE;
/*
in the CE folders i will have 3 or 4 classes
ideally when i use App\Http\Controllers\Classes\CE it 
will inherit or use all the classes in it. 
*/

use App\Http\Controllers\Classes\User;
/*
in the User folders i will have 3 or 4 classes
ideally when i use App\Http\Controllers\Classes\User 
it will inherit or use all the classes in it.
*/

Lastly, i was told by my colleague (CakePhp expert) that using too many use....(use App\User, use App\CE, use App\History, etc) on the top of my controller file will consume higher resources which will eventually impact the application performance. Does anyone know a thing or two about this to share. That'll be really helpful.

Hopefully this is clear, do share if you have a better way of structuring, that'll definitely be helpful.

Thanks in advanced!

May
17
3 years ago
Activity icon

Started a new conversation Database Performace

Hi guys, I am trying to optimise my query/server performance and was hoping someone can share some tips and alternate solutions i can approach to improve performance.

Take for example (i am using this example to better simplify my problem) i have a Dynamically populated Calendar and many events(reminder, task, to-do). On load i will return the days in the month with the events with it.

Solution 1 : I tried doing individual query to the my events by the date

Events::where('date','='$currentDay)->get();
//30 plus/minus query calls

Solution 2 : Store the result for every solution in a container and loop it

$events = Events::all();
//i can fetch events belonging to only the current month too, 
//but this is just an illustration of a similar situation i have
foreach($events as $e){
//check for date if true add to array a bind it to calendar date
}

Due to my limited experience in coding, i haven have any ideas on better implementations to boost performance. Can anyone suggest/recommend a better approach? I hope this is clear and many thanks in advanced!

Apr
06
3 years ago
Activity icon

Started a new conversation Laraforge To Host Non-laravel Websites

Hi guys,
I am not sure if this is the right place to ask this question. I am planning to do a simple html/js/css website and have it hosted on my digitalocean server that is setup through laraforge, theres plenty of space there.
I have 2 question pertaining to this.

  1. does forge supports non-laravel websites?

  2. Is it possible to remove .php/.html extension through nginx, the homestead/forge way of setup? Been hunting around for "domain.tld.conf" as advice here on my homestead setup. But i can't seem to find the .conf file.

Any advice?

Mar
29
3 years ago
Activity icon

Replied to Anyone Successfully Set Up VueStrap? By Kzima?

@rk,
did you managed to get datetimepicker to work? I can get dropdown and popover to work. But no idea why datetimepicker just dont.

Mar
23
3 years ago
Activity icon

Replied to Gulp Watch With Elixir Not Watching

@zellkz , Awesome. Thanks for sharing!