Ruby on Rails to Laravel helper class and how do I do this?

Posted 5 months ago by midwestdev

I am in the process of moving an existing intranet site from Rails to Laravel. In the Rails app I have a section that generates a page with a slider that shows 35 different charts.

I have a helper view that contains the div for the slider, sample below

        <!-- SLIDE NUMBER 1 @top_signups && @top_interests -->
        <div class="slide" style="height:80vh;">
            <h1>Top Signups and Interest Areas</h1>
            <div style="display:flex;align-items:center;justify-content: space-around;">
                
                <%= graph 'top-signups', 'horizontalBar',  @chkpt_top_signups, "Top Sign Ups", "half-page", "false", "true" %>
                <%= graph 'top-interests', 'bar',  @chkpt_top_interests, "Top 5 Interest Areas (Last 45 days)", "half-page", "false", "true" %>
            </div>
        </div>
        <!-- SLIDE NUMBER 1 @top_signups && @top_interests -->
        <div class="slide" style="height:80vh;">
            <h1>Sales by Package</h1>
            <div style="display:flex;align-items:center;justify-content: space-around;">
                <%= graph 'sales-by-package', 'bar',  @chkpt_sales_by_package, "Sales By Package", "full-page", "false", "true" %>
            </div>
        </div>
        <!-- SLIDE NUMBER 2 @sales_this_year && @installs_this_year -->
        <div class="slide" style="height:80vh;">
            <h1>Sales &amp; Installs This Year</h1>
            <div style="display:flex;align-items:center;justify-content: space-around;">
                <%= graph 'sales-this-year', 'bar',  @chkpt_sales_this_year, "Sales this Year", "half-page", "false", "true" %>
                <%= graph 'installs-this-year', 'bar',  @chkpt_installs_this_year, "Installs this year", "half-page", "false", "true" %>
            </div>
        </div>

This helper is called from the main layout file Inside of this template, I call another function called graph which generates the graph with the values I have above. I am just wondering if there is are helper functions that will allow me to do something similar in laravel?

Please sign in or create an account to participate in this conversation.