dan3460

Experience

7,550

0 Best Reply Awards

  • Member Since 2 Months Ago
  • 55 Lessons Completed
  • 0 Favorites

20th February, 2018

dan3460 left a reply on Vue Draggable Cannot Drop In Other Table • 1 day ago

If anyone cares, i found the solution the min-height must be declared at the level for the drop to an empty table to work. Thanks for the help.

19th February, 2018

dan3460 left a reply on Vue Draggable Cannot Drop In Other Table • 2 days ago

Thanks for the answer, right i'm starting with both tables with some data. The problem becomes when one of the tables gets empty. It seems to me a lot of programming to keep checking when one of the tables becomes empty, to then add a empty row there. Also i think that row will need to be made non-draggable. I will post on the vue draggable site a issue, and see what the response is. In the mean time i think i will make the tables into lists, which seem to be working

dan3460 left a reply on Vue Draggable Cannot Drop In Other Table • 2 days ago

I have been working on this the entire morning and i'm getting there. I started from scratch using one of the samples from the vue.draggable web site. Then added and replace things to make it in to a couple of tables and i can move elements from one table to another. Now my problem is when the table is empty or becomes empty, then it does not accept an element. The documentation calls to give the element a minimum height, as you can see in the code below i have been adding the min-height everywhere but it doesn't work. My first attempt was to put the min-height on the draggable element, that did not work. Thanks for any ideas you may have:

<template>
    <div class="row">

        <table class="table dragArea">
            <thead>
                <tr>
                    <th>ID</th>
                </tr>
            </thead>
            <draggable v-model="approveDocsNew" :options="{group:'people'}" :element="'tbody'">
                <tr v-for="element in approveDocsNew" class="dragArea">
                    <td class="dragArea">{{element.document_id}}</td>
                </tr>
            </draggable>
        </table>
        <table class="table dragArea">
            <thead class="table">
                <tr>
                    <th>ID</th>
                </tr>
            </thead>
            <draggable v-model="forApprovalDocsNew" :options="{group:'people'}" :element="'tbody'">
                <tr v-for="element in forApprovalDocsNew" class="dragArea">
                    <td class="dragArea">{{element.document_id}}</td>
                </tr>
            </draggable>
        </table>
    </div>
</template>

<script>
    import draggable from 'vuedraggable'

    export default {
        components: {
            draggable
        },

        props: ['approvedDocs','forApprovalDocs'],

        data() {
            return {
                approveDocsNew: this.approvedDocs,
                forApprovalDocsNew: this.forApprovalDocs
            }
            
        },

        method: {

        }
    }
</script>

<style>
.dragArea {
  min-height: 10px;
}

</style>

18th February, 2018

dan3460 started a new conversation Vue Draggable Cannot Drop In Other Table • 3 days ago

I'm working on a project where i think Vue Draggable is the best solution for what i want to do which is to drag an item from one table and drop it in another. I have been following Andre Madarang video and i have most of it working. I can move thing around within each table but i cannot grab from one and drop in the other, here is the code:

<template>
    <div class="row">
        <div class="col-6">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">Available Documents</h5>
                </div>
                <div class="card-body">
                    <table class="table table-sm" id="availDocs">
                        <thead>
                            <tr>
                                <td>ID</td>
                            </tr>
                        </thead>
                        <draggable class="min-height" v-model="approveDocsNew" :list="approveDocsNew" :options="{group:'document'}" :element="'tbody'">
                            <tr v-for="(approveDoc, index) in approveDocsNew">
                                <td>{{approveDoc.document_id}}</td>
                            </tr>
                        </draggable>
                    </table>
                </div>
                <div class="card-footer text-muted">
                    Footer
                </div>
            </div>
        </div>
        <div class="col-6">
            <div class="card">
                <div class="card-header">
                    <h5 class="card-title">Selected Documents</h5>
                </div>
                <div class="card-body">
                    <table class="table table-sm" id="selDocs">
                        <thead>
                            <tr>
                                <td>ID</td>
                            </tr>
                        </thead>
                        <draggable class="min-height" v-model="forApprovalDocsNew" :list="forApprovalDocs" :option="{group:'document'}" :element="'tbody'">
                            <tr v-for="(forApprovalDoc, index) in forApprovalDocsNew">
                                <td>{{forApprovalDoc.document_id}}</td>
                            </tr>
                        </draggable>
                    </table>
                </div>
                <div class="card-footer text-muted">
                    Footer
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import draggable from 'vuedraggable'

    export default {
        components: {
            draggable
        },

        props: ['approvedDocs','forApprovalDocs'],

        data() {
            return {
                approveDocsNew: this.approvedDocs,
                forApprovalDocsNew: this.forApprovalDocs
            }
            
        },

        method: {

        }
    }
</script>

I probably missed something on the tutorial, any ideas?

dan3460 left a reply on Adding Vue To A Project • 3 days ago

Thanks, looking on the web that the error relates to eslint plugin, and suggested to set vetur.validation.template=false. That took the error out, don't what else does but seems to be working. I got a vue extension on crome, i can see there that the data is passed as an array and there only the fields of the original model. Don't know if i want to pass a json with all the associated models. I probably will tailor a structure that contains the fields that i want to pass to the vue module.

Thanks again for the help

dan3460 left a reply on Adding Vue To A Project • 3 days ago

I spent several hours last night chasing an error showing on VSC with Vetur extension v-for: elements in the interaction expect to have a b-bind:key. By coincidence i had an spelling error with in the loop (this is an iteration for a table), i realized my mistake and this morning the table render on the screen. Vetur still showing the error. Is Vetur the best extension for Vue? The other problem that i have is with relations in Laravel models, i normally refer to field to related tables in this way model1->model2->fieldwanted Can i use the Model relations in Vue? Thanks for the help.

17th February, 2018

dan3460 left a reply on Adding Vue To A Project • 4 days ago

Thanks very much, appreciated

dan3460 left a reply on Adding Vue To A Project • 4 days ago

@topvillas woaaa, that was quick. Wold the installation take care of the package.json, i think there are some parameters that need to be there? Any other dependency that i have to be aware of?

Thank very much,

dan3460 started a new conversation Adding Vue To A Project • 4 days ago

I started a project that replaces an older one about a month ago. I'm new to Laravel and even newer to Vue. I wanted to use the new bootstrap 4 so with help form here i remove all presets and install bootstrap 4 and works fine. I have come to a part of the project where seems that vue draggable will be perfect to select documents from one list and drag them to another. I just looked in the application and all traces of vue seems to be absent, i'm guessing that got erased when i removed the presets. What would be the best way to setup vue on this existing project? Thanks very much for the help.

dan3460 left a reply on Scheduling Commands, Where To Put The Logic • 4 days ago

Thanks, i have put most of the logic on the command side, with the logic to render the email on the mailable. Once you understand the way this work makes really easy to send sophisticated email at intervals or events.

14th February, 2018

dan3460 left a reply on Scheduling Commands, Where To Put The Logic • 1 week ago

Maybe i did not express myself clearly. English is not my native language. I'm using an artisan command and i'm using the task scheduler. With this i'm creating two classes, the command class and the mailable class, my question was more in the way to write the logic, your spread the logic into the two classes or you put most of your logic in one of the classes?

dan3460 started a new conversation Scheduling Commands, Where To Put The Logic • 1 week ago

I have a series of processes that triggers an email to be sent, for example if a document has expired will send an email to the owner of the document. There are two distinct pieces of logic to go through, first selecting each document to be act upon and second get the information of the owner to send the email. My initial thought is to put the logic for the first step in the command file and send the owner ID and document ID to the mailable having it pulling the information for the owner and send the email. Or would you rather have all the logic in the command or the mailable? Is there a laravel way?

10th February, 2018

dan3460 started a new conversation Using SQL Views, Best Practices • 1 week ago

I'm working on a part of the application where i see that the best way to obtain the information that i need is via a view on the database. On that view i can apply things line show unique, sort, etc. It seems to me easier than creating the relationships in Laravel, maybe is not but is my upbringing using SQL speaking.

  • I'm creating a model to handle the view - Is anything special that i should do to the model? I have seen protected $guarded=[] but the posts are several years old.
  • Any other suggestions to handle views?

Thanks for the help.

dan3460 left a reply on Retrieving Files From /storage/app/documents • 1 week ago

In case anyone follows this, my solution was to basically make a temporary copy of the file within the public folder. I still have to resolve the delete of the temporary file, right now is being deleted after one hour by a crontab process. I tried to check when the w=window.open() command was done, but i think that because is handled on a iframe the test $(w).ready() returns true right away thus the iframe doesn't display the document.

8th February, 2018

dan3460 left a reply on Retrieving Files From /storage/app/documents • 1 week ago

@arthruvillar i was writting this when i saw your post:

Yes it does, i can open the file if i navigate to the folder. Did not get an exception. I went for a cup of tea and done some thinking, please correct me if I'm wrong. The `window.open()` command is looking for an url that can attach to the iframe, therefore it will never going to be able to open a non public folder. ```

So using Arth idea and that i have to make sure that even authorized users do not have access to each other's files, i will make a temporary copy of the file that can be uploaded by the `window.open()` command. This is probably not as efficient as Arth solution but i feel that is more secure.

Thanks everyone for the help
 

dan3460 left a reply on Retrieving Files From /storage/app/documents • 1 week ago

I'm still learning Laravel, so please bear with me. To upload the file the user selects it in a form, then i have the following to store the file: $doc->document_location=$request->file('file')->store('documents'); which gives me the location and the name (hash) to store in the database. Then to display i have a blade with a iframe to show the document using a winddow.open(), i tried the following but got an empty string window.open('{{Storage::disk('local')->get('documents/KxfAL72tsX18kzZyfwLRjLjHyWILXHGWnvBRvze3.pdf')}}','docFrame'); For sure i'm doing something stupid.

dan3460 started a new conversation Retrieving Files From /storage/app/documents • 1 week ago

We are doing a rewrite of our document management system, the system currently stores the document in a blob on the database. I'm exploring the possibility of storing the documents outside the database and Laravel makes that super easy. The files are stored in the path given above, now i'm playing with retrieving the document for display. if I use storage_path("nameOfDocument") get an error "Not allowed to load local resource", which makes sense. For what i read the solution is to make a sim-link from the public folder to the storage folder, my problem is that exposes the documents to the web. Is there a way to do what i need to do?

7th February, 2018

dan3460 started a new conversation Intelliphense Add Use Not Working On VSCode • 2 weeks ago

I hope that i bunch of you are using Intelliphese with VSCode. It works fine with one exception, id i type a model name it adds the USE statement at the top of the file. If i copy the model from somewhere else, which i do not expect to automatically add the USE statement, and right click and select Add Use declaration it show an empty list. I know that is a minor thing but i see in many YouTube clips people using it. Any ideas how to setup intelliphense?

6th February, 2018

dan3460 left a reply on File Save To Database. • 2 weeks ago

Correct, i do understand that. The problem is that the database is access also by a desktop program, that is why we only store the data of the file in the blob. A few years ago was an internal discussion and i put it to the web too, about storing documents on the database, it was like discussing about religion. The opposing camps have no clemency for the other's view. The main reason for using it is that the document can be accessed by the desktop program and there is no messing with permissions or exposing folders to the web. Secondary reason was the easy of backup, you only backup the database.

5th February, 2018

dan3460 left a reply on File Save To Database. • 2 weeks ago

I thought that was an instance of the file object, which contains more than just the data. If $file is save in a blob, can it be retrieved directly from the database? I can do this now by saving the blob and adding the pdf extension to it.

dan3460 started a new conversation File Save To Database. • 2 weeks ago

I'm in the process of rewriting an old application, which was done with JQuery, Html and php (not even classes on the php side). Is an application to manage documents in pdf format. It was a discussion why it made sense to put the documents in database and has been working fine. After submitting the form we grab the document and make it into an binary variable which is save in a blob on the database.

$currFile=$_FILES['file']['tmp_name'];
$bin_data= addslashes(fread(fopen($currFile, 'rb'), filesize($currFile)));

I did see, or maybe i miss it, on the documentation in how to do similar thing with Laravel. I guess i could use the same function above but maybe a Laravel way to do this.

Thanks for the help.

4th February, 2018

dan3460 left a reply on The Page Has Expired Due To Inactivity • 2 weeks ago

In my experience that happens when there is no csrf token on the form. Make sure that you include {{ csrf_field() }} like this:

                                <form id="logout-form" action="{{ route('logout') }}" method="POST"
                                      style="display: none;">
                                    {{ csrf_field() }}
                                </form>

dan3460 left a reply on Bootstrap And A New Project • 2 weeks ago

Thanks for the help, i restarted the application and it worked. Don't know what went wrong with the previous one.

3rd February, 2018

dan3460 left a reply on Bootstrap And A New Project • 2 weeks ago

I'm starting again from scratch. I will make a new laravel, i will run auth, then artisan present none install bootstrap 4 and popper. I hope that does it.

dan3460 left a reply on Install Bootswatch 4 Theme In Laravel 5.5 • 2 weeks ago

Nice just in time for my project. Thanks. One question how do you use the theme you selected? lets say Yeti?

dan3460 left a reply on Bootstrap And A New Project • 2 weeks ago

No i did not. Should i run preset non and reinstall booststra4? or do in need to uninstall bootstrap 4?

dan3460 started a new conversation Bootstrap And A New Project • 2 weeks ago

I'm starting a brand new project. Created the Laravel application, set up the server, got git running. I upgraded to bootstrap 4, or at least i thought so, and i got stuck on placing the nav-brand in line with the rest of the menu. I copy the navbar from the bootstrap website, i have done nothing to it except for change the last button to a login button. I cannot get the brand in line with rest of the menu.!!! one clue could be that i could not get the menu to work, it was showing the hamburger at the start, i have to add the cdn bootstrap in the master template. here is the menu:

 <nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse">
    <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    </button>

    <a class="navbar-brand" href="">NavBar</a>
    <div class="collapse navbar-collapse">
        <ul class="navbar-nav mr-auto">
            <li class="nav-item active">
                <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">Link</a>
            </li>
            <li class="nav-item">
                <a class="nav-link" href="#">Disabled</a>
            </li>
            <li class="nav-item dropdown">
                <a class="nav-link dropdown-toggle" href="http://example.com" id="dropdown01" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dropdown</a>
                <div class="dropdown-menu" aria-labelledby="dropdown01">
                <a class="dropdown-item" href="#">Action</a>
                <a class="dropdown-item" href="#">Another action</a>
                <a class="dropdown-item" href="#">Something else here</a>
                </div>
            </li>
        </ul>
        <form class="form-inline my-2 my-md-0">
            <a class="btn btn-outline-success my-2 my-sm-0" href="{{ route('login') }}">Login</a>
        </form>
    </div>

</nav>

Any ideas ?

dan3460 started a new conversation Auto Data Entry Into Desktop Application • 2 weeks ago

I have been looking for a piece of software that can take data (either directly from an Laravel application or a file) and emulate the human typing. This is the scenario, i have a desktop application that i don't have access to the database nor there is any way to connect to it. They only want you to use the data entry screens. The person in the front desk has to re-enter all the information from the appointments system into the back office system every time. I looked in google but it seems to me, my keywords for the search may have been wrong, that systems are very expensive or there are a form or auto-fill. looking for ideas as to where to look.

Thanks for the help,

26th January, 2018

dan3460 left a reply on Redirecting From A Button Inside A Table • 3 weeks ago

Understand, makes sense. That shows you again, how little i know, until 6 months ago i was coding in c++ and i thought that any application that was interacting with a database on the web was doing so in a similar fashion as remote desktop or citrix interacts with a server. In other words i thought that the application resided in the server and only screen flashes where shown to the user. :( This is a new world to me, which I think is fascinating. Every corner that i turn there are new things and techniques to learn. I'm also glad that people like you are out there, willing to answer the stupid question that people like me have. Thanks again i really appreciate.

dan3460 left a reply on Redirecting From A Button Inside A Table • 3 weeks ago

Thanks, it works. I thought that GET would also required csrf, that tells you how little i know.

dan3460 started a new conversation Redirecting From A Button Inside A Table • 3 weeks ago

Many of my questions will probably be trivial to you, but still learning. I have a table that is fill with a foreach loop. One of the fields of the table has a button to edit the underling record, the button has a value. Before laravel i would use a function $.redirect, to go to a different page when the button was pressed. The problem that i'm having is that the controller is expecting the csrf-token, which i think is not passed by the function $.redirect. Before i go digging on the function to see if i can modify it to pass csrd-token, i wanted to ask you guys how have you solved this problem before.

<table>
    <tr>
        <td>bla bla</td>
        <td>xixixi</td>
        <td><button class="editData" value="someValue1">click here</button></td>
        <td>bla bla</td>
        <td>xixixi</td>
        <td><button class="editData" value="someValue2">click here</button></td>
    </tr>
</table>

<script>
    $.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
    });
    $(".editData").click(function(){
        $.redirect("/someUrl",{val:$(this).val()});
    });
</script>

25th January, 2018

dan3460 left a reply on Mail Verbose Option? • 3 weeks ago

@Snapey , you are a whiz. I was using the same account to send emails from the contact form and for administration, using a different from for each. I'm changing the area where the email comes from to the reference line.

Thanks again, i wasn't dealing directly with Rackspace, the person that was my intermediary wasn't really useful i was pulling my hair our, trying to solve this.

dan3460 started a new conversation Mail Verbose Option? • 3 weeks ago

I'm trying to test why i cannot send emails with the credentials given by rackspace. So far this is what i have done:

  • Put the credentials of my email and i can send emails to me. This tells me that the web site works.
  • Put the credentials for Rackspace and get nothing, no error just silence. Added an extra letter to the password, get an credentials error. This tells me that i'm loggin in the Rackspace server.

Of course the guy in charge of the account at Rackspace blames my web site.

Is there a way to setup a verbose response form the Email sytem.

19th January, 2018

dan3460 left a reply on Mail Send Not Working • 1 month ago

@ejdelmonico, i swear that it was working before (i made the contact form about 2 weeks ago). I did not have guzzle installed. Embarrassing. Didn't have to change anything else, just install guzzle.

Thanks everyone.

dan3460 left a reply on Mail Send Not Working • 1 month ago

getting the data:

array:5 [▼
  "name" => "Test"
  "email" => "[email protected]"
  "phone" => "123456"
  "msg" => "This is the message"
  "pref" => "phone"
]

dan3460 started a new conversation Mail Send Not Working • 1 month ago

I have look around on google but i think my problem is different of just misspelled or wrong setup file. Right now i have the .env setup for mailtrap, using Tinker i can send a simple email using Email::raw(). So the configuration is working. I have the following method to send an email:

    public function sendForm()
    {
        Mail::send('emails.contact',[
            'name'=>request('customerName'),
            'email'=>request('customerEmail'),
            'phone'=>request('customerPhone'),
            'msg'=>request('customerMessage'),
            'pref'=>request('commPreference')
        ], function($msg){
            $msg->from('[email protected]');
            $msg->to('[email protected]', 'Admin')->subject('Web Site Request');
        });
  
        //return redirect('/')->with('message', 'We will get back to you very soon....Thanks');
    }

I commented the return to make sure that i was hitting the method, i'm getting a blank page. So i'm hitting the method. i typed the mail command in tinker, replacing the requests with hard coded data and it worked. How i can troubleshoot that the method is actually calling the mail function?

18th January, 2018

dan3460 left a reply on Carbon Question Really, Making A Only Time Stamp From A Timestamp • 1 month ago

Hummmm... I think you are right. It does look simpler and probably quicker than calling carbon a bunch of times in a for loop.

Thanks to everyone for the ideas.

dan3460 left a reply on Carbon Question Really, Making A Only Time Stamp From A Timestamp • 1 month ago

The problem there is that the array doesn't have a date, so it is created as a date from 1975 (or something like that), when you compare with the timestamp, the timestamp is always bigger.

dan3460 left a reply on Carbon Question Really, Making A Only Time Stamp From A Timestamp • 1 month ago

Thanks, that is very similar to what i have. The foreach slot part i doing it exactly the same way. The difference is that your $matched is coming from a timestamp from a database. I thought that may be a function that allows you to get just the time part but as a carbon instance to you can test against times, was looking a shorter way to do it. In other words, to create your matched value i will have to:

1- separate the timestamp into its components: $parts=explode(" ",$timestamp)
2 - create a carbon instance with the time part: $matched=Carbon::createFromFormat('H:i:s',$parts[1];

I was just wondering it it was a function that will do that directly from the database.

dan3460 left a reply on Carbon Question Really, Making A Only Time Stamp From A Timestamp • 1 month ago

It is a simple array with times as this:

slots={"08:00","08:15","08:30",....}

The timestamp, besides the actual date, can have a time such as 08:10:31. To make the comparison i could do something such as this:

$timePart=$timeStamp->toTimeString();
$compareTime=Carbon::createFromFormat('H:i:s',$timePart);

Then i can see on which slot the $timeStamp falls.

dan3460 left a reply on Carbon Question Really, Making A Only Time Stamp From A Timestamp • 1 month ago

The array 0nly has slot times by "day" of the week. When converted to carbon will have a weird actual date but it can be compared with other times created in the same way. So I cannot change everything to carbon. Also changing the time to a number doesn't help with how to extract the time from the timestamp, still seems that I need a multi step process.

17th January, 2018

dan3460 started a new conversation Carbon Question Really, Making A Only Time Stamp From A Timestamp • 1 month ago

I have an array of time slots for a specific day of the week. In the other hand i have a timestamp for a specific date and time. The time slots are formated as "08:00", "08:15", etc. i can easily make them into a carbon time using Carbon::createFromFormat(), no problem there. So in order to compare the timestamp with my time slots, seems to me that i have to get the timestamp, convert it to string, extract the time and convert that back to a carbon date to make the comparison. I looked in the Carbon docs but could not find either been able to compare only times or directly create a carbon date from the time part of the timestamp. I hope this is not too confusing

14th January, 2018

dan3460 left a reply on Send User To Page If Email Not Verified, Not Working • 1 month ago

Thanks Bobby, your post gave an idea. I move the method notverified to a different controller (main controller) and now it works. I do want to explore your idea do, that seems more cleaner. Thanks again

dan3460 started a new conversation Send User To Page If Email Not Verified, Not Working • 1 month ago

I have set up a email verification process that is working fine, the next step is to return the user to a page displaying that the user has not been verified yet. On the HomeController and the RedirectIfAuthenticated i have the following code that redirects to the appropate page depending on the type of user: HomeController:

    public function index()
    {
        if(Auth::user()->verified == 0){
            return redirect('/notverified');
        }

        if(Auth::user()->role_id == 1){
            return redirect('/administrator');
        }
        if(Auth::user()->role_id == 2){
            return redirect('/broker');
        }
        if(Auth::user()->role_id == 3){
            return redirect('/trucker');
        }
        if(Auth::user()->role_id == 4){
            return redirect('/warehouse');
        }           
    }

RedirectIfAthenticated:

    public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            if(Auth::user()->verified == 0){
                return redirect('/notverified');
            }
            if(Auth::user()->role_id == 1){
                return redirect('/administrator');
            }
            if(Auth::user()->role_id == 2){
                return redirect('/broker');
            }
            if(Auth::user()->role_id == 3){
                return redirect('/trucker');
            }
            if(Auth::user()->role_id == 4){
                return redirect('/warehouse');
            }
        }

        return $next($request);
    }
}

The role_id check works fine, but when i put the check for verified gives me an error of page not working ERR_TOO_MANY_REDIRECTS. I can manually call the route /notverified and sends me to the page. The only difference that i see is that the verified field is not in the mass assigned in the User model. Really lost on this one.

12th January, 2018

dan3460 left a reply on @if Else Shows Both Options. • 1 month ago

No, originally just the two. On the second test, only one on the whole page. I have rearranged the templates, because i have several pages that are common to two different roles, i have created one template where the navigation is called depending on the role assigned to the user. That work fine.

10th January, 2018

dan3460 left a reply on @if Else Shows Both Options. • 1 month ago

Humm, that is interesting. I'm running 5.5 and you can see on my second post the layout should have not been run but it did. Maybe is something on the layout itself. @tykus suggestion works.

dan3460 left a reply on @if Else Shows Both Options. • 1 month ago

That is clever!!, i will give it a try. Thanks

dan3460 left a reply on @if Else Shows Both Options. • 1 month ago

I did the following experiment:

@if (1 == 2)
    @extends('layouts.broker')
@else
    <h1>second</h1>
@endif 

This should only shows "second" on the page, but it shows the word second and intimidatingly after the layout broker. I think the blade engine is getting confused with the @extends directive and executes that no matter what. Is this correct?

dan3460 started a new conversation @if Else Shows Both Options. • 1 month ago

I have the following statements:

@if ((Auth::user()->role_id) == 2)
    @extends('layouts.broker')
@else
    @extends('layouts.trucker')
@endif 

The page is showing both layouts. This is the first time that i use an @if-else-endif estatment so i may be missing something.

7th January, 2018

dan3460 left a reply on Array Push Inside A Class Doesnt Work • 1 month ago

Thanks and that explanation clarifies the problem. I'm not filling the array with "08:00" is just for testing. There is a calculation that goes in place of the 08:00. Actually you are close, until recently i was programming exclusively in c++. Thanks very much

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.