dmcglone

dmcglone

Member Since 5 Years Ago

Columbus Ohio

Stay at home Dad at According to my kids, I work at "their" house.

Experience Points 16,150
Experience Level 4

3,850 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 270
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.

15 Jan
3 years ago

dmcglone left a reply on Checkbox Still Checked With NULL

Thanks everyone for giving me a hand on this, took me a minute to be able to get back to this and work it out. Might not be the most efficient way, but hey it's a breakthrough to me.


 DB::table('users')
            ->where('employee', 1)
             ->update(array('employee' => 0));

        $user = User::findOrFail($id);
        $user->update($request->all());

06 Jan
3 years ago

dmcglone left a reply on Checkbox Still Checked With NULL

That just may work. I'll try doing it that way and see what comes of it.

dmcglone left a reply on Checkbox Still Checked With NULL

I understand now.

So from what I gather from all the information in this thread, the only way to accomplish this is to check for any 1's in the db and change them to a 0 before updating a different row to be 1.

05 Jan
3 years ago

dmcglone left a reply on Checkbox Still Checked With NULL

@bashy, I'm not sure I understand what you're saying.

Let's say I have a checkbox. If I uncheck the checkbox and submit it, it will put a 0 in the db. What I'm aiming for is instead of a 0, I want the row to be the default NULL .

Keep in mind,

{!! Form::checkbox('employee', "NULL") !!}

The NULL in the code is actually just text and isn't the same as a newly created row that has NULL set as the default and doesn't work the same either.

I've also tried other variations listed in previous comments to no avail.

I hope that makes sense. I'm basically chasing, if you will, that "default NULL"

dmcglone left a reply on Checkbox Still Checked With NULL

@deringer, Ok I'll look into it.

@mercuryseries, That is the way I had it once, which does work, but I was hoping to use a unique constraint hoping if a different checkbox was chosen, any row in the db that is true would reset to NULL on submission.

The reason for wanting NULL instead of 0, is because the unique constraint only allows one row to be true(1) or false(0), but many rows can be null.

On the flip side, If I remove the unique constraint, then it allows more than one row to be true (1)

I'm wondering if it would be better to just create a pivot table and just add the employee id to it to identify the corresponding employee in the users table and when it's updated, just overwrite that record. Think that's a good idea?

dmcglone left a reply on Checkbox Still Checked With NULL

Maybe a better way to put it is, is it possible to force every row to be null unless it is a 1?

dmcglone left a reply on Checkbox Still Checked With NULL

Right, which brings me to the question, is it possible to force the row to revert no null automatically if the field is left empty or if it contains a 0?

dmcglone left a reply on Checkbox Still Checked With NULL

Thanks guys. I think I figured out my problem. It seems specifying 'NULL' in the form field isn't the same as when it's set by phpmyadmin. Or when a new row is inserted which defaults to NULL.

Is it possible to always force a default NULL if the row is 0 or empty.

This doesn't work, because it's not really NULL, it's a string.

{!! Form::hidden('employee', 'NULL') !!}

This doesn't work, because I can't have no more than 1 of the same value.

{!! Form::hidden('employee', 0) !!}

This doesn't work, because it's an empty string.

{!! Form::hidden('employee', '') !!}

04 Jan
3 years ago

dmcglone started a new conversation Checkbox Still Checked With NULL

I'm trying to get my checkbox to be unchecked when NULL is in the db and checked when it is 1 (true), but it seems the checkbox will not uncheck unless I use a 0. Is it possible accomplish something like this using something like 'checked' => 'none'? The reason I ask is because I want to add a constraint so only 1 row can be true at any given time.

{!! Form::hidden('employee', 'NULL') !!}

 {!! Form::checkbox('employee', 1) !!}

29 Nov
3 years ago

dmcglone left a reply on Completely Fed Up

I didn't know of any other service I could use. I didn't know about mailtrap until the other day, and at that time I was afraid to switch because I might run into problems. I also thought I was going to have to add this and that and everything else when my ultimate goal was to understand Laravel's Mail, so in my mind I was eliminating as much learning about anything else as I could.

dmcglone left a reply on Completely Fed Up

Ok guys.. Couple things..

@bashy I wan't using mailtrap because I didn't want to add that extra headache if anything had went wrong, so I stuck with what I knew worked. But.....I took the plunge and tried setting up mailtrap and had only one minor hiccup. Should've looked in my inbox for the credentials... lol

So now mailtrap works great, let me recap here a second. If I could what appeared to send a message with an embedded image using google's smtp, but never receive it, but why is it that I can send just fine using mailtrap?

dmcglone left a reply on Completely Fed Up

@zachleigh I tried using a plain html link, and the e-mail is never received.

@andrewb that's another baffling question. Chrome dev tools, doesn't show any errors. and seems to send the message without problem.

I have narrowed the problem down to what I believe is the image tag, because anytime I add an image tag, the e-mail appears to send, but is never received. Funny though, that I am able to attach a file easily. I'll post the code.

my controller

$user = User::findOrFail($id);
        $subject = $request->get('subject');
        $user_message = $request->get('message');

        $file_attachment = $request->file('file_attachment');

        if($file_attachment)
        {
            Image::make($file_attachment->getRealPath())->resize(200, 200)->save($file_attachment);
            $file_attachment->move('tmp/', $file_attachment->getClientOriginalName());
        }


        Mail::send('emails.administrator_message',
            ['user' => $user, 'subject' => $subject, 'user_message' => $user_message,
             'file_attachment' => $file_attachment],
            function ($message) use ($user, $subject, $user_message, $file_attachment)

            {
                $message->from('david.mcglone@gmail.com', 'David');
                $message->to($user->email, $user->first)->subject($subject);

                if($file_attachment)
                {
                    $message->attach(public_path() . "/tmp/" . $file_attachment->getClientOriginalName());
                }
            });

        if($file_attachment)
        {

            unlink(public_path() . '/tmp/' . $file_attachment->getClientOriginalName());
        }

          return redirect('admin');
    }

blade template that works

<a href="http://www.google.com">Google</a> Link tags work
<p>{!! $user->first !!}</p>
<p>{!! $user_message !!}</p>

blade template that will not send no matter what I try. I've tried hundreds of different img tags and configurations. I've sent so much mail I'm afraid google is going to shut down my account.. lol

<a href="http://www.google.com">Google</a> Link tags works

<img src="{!! $message->embed(file_path() . "/images/" . "header2.png") !!}"> No luck with embedding an image

<p>{!! $user->first !!}</p>

<p>{!! $user_message !!}</p>

Why couldn't embedding an image be as easy as attaching one? lol

28 Nov
3 years ago

dmcglone started a new conversation Completely Fed Up

I am so fed up with this. I've spend over a week trying to figure out why sending an image doesn't work. I've tried ever possible combination I could find. I did manage to get it partially working.

check this code out to see what I mean.

The below code works

<div class="container">
    <div class="col-md-12">
        <div class="col-md-6"><a href="/">{!! Html::image('images/header2.png') !!}</a></div>
        <div class="col-md-4 col-md-push-2">@include('inc.weatherWidget')</div>
        <div class="col-md-2">@include('inc.social')</div>
        <div class="col-md-12">@include('inc.nav')</div>
    </div>

Now I can take the above code and remove either 1 2 or 3 lines and it just quits working. (I'm only interested in the img tag line. It's frustrating!

I've also tried every possible image anchor tag combination I could find from what others have posted with the same problem. Some here on Laracasts.

27 Nov
3 years ago

dmcglone left a reply on Laravel Mail Seems To Be Broken

@lstables @JeffreyWay I switched to an old project from Laravel 4 that I know works to see If I could re-produce the behavior and all I have to do is simply clean up the code and remove blank lines and the e-mail never is received. This has to be a problem with laravel or some kind of cache, or something I don't know about that is causing it to not send the e-mail. Basically the problem happens if I remove anything from the original working copy, but never if I add something.

This code works without a problem

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>See it here</title>
    <meta name="keywords" content="" />
    <meta name="description" content="" />
    {{ HTML::style('themes/default/css/evaluationEmail.css') }}
</head>

    <body>
    <div id="wrapper">
        <div id="header">
            @include('includes.Header')
        </div>

        <div id="content">
            <div id="emailWrap">

                <h3>David, {{ Input::get('name') }} has sent you a message.</h3>

                <div class="personalDetails">
                    <span class="left">Name: {{ Input::get('name') }} </span>
                    <span class="left">Phone: {{ Input::get('phone') }} </span>
                    <span class="left">E-Mail: {{ Input::get('email') }} </span>
                </div>


                    <br/>Message:<br/>

                    <div class="description">{{ input::get('message') }}
                </div>
            </div>
        </div>
        </div>

        <div id="footerSpacer"></div>
        <div id="footer">@include('includes.Footer')</div>

    </div>

    </body>
    </html>

Cleaned up the code by removing the blank lines and nothing is received in e-mail

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>See it here</title>
    <meta name="keywords" content=""/>
    <meta name="description" content=""/>
    {{ HTML::style('themes/default/css/evaluationEmail.css') }}
</head>
<body>
<div id="wrapper">
    <div id="header">
        @include('includes.Header')
    </div>
    <div id="content">
        <div id="emailWrap">
            <h3>David, {{ Input::get('name') }} has sent you a message.</h3>
            <div class="personalDetails">
                <span class="left">Name: {{ Input::get('name') }} </span>
                <span class="left">Phone: {{ Input::get('phone') }} </span>
                <span class="left">E-Mail: {{ Input::get('email') }} </span>
            </div>
            <br/>Message:<br/>
            <div class="description">{{ input::get('message') }}
            </div>
        </div>
    </div>
</div>
<div id="footerSpacer"></div>
<div id="footer">@include('includes.Footer')</div>
</div>
</body>
</html>

dmcglone left a reply on Laravel Mail Seems To Be Broken

Just the basic twitter navbar html

dmcglone left a reply on Laravel Mail Seems To Be Broken

Sorry, this is the e-mail blade template

@extends('inc.email')
@section('content')
    <p>Dear {!! $user->first !!},</p>

    <p>{!! $user_message !!}</p>
@endsection

dmcglone left a reply on Laravel Mail Seems To Be Broken

The e-mail view is the very first one I posted.

dmcglone left a reply on Laravel Mail Seems To Be Broken

I'm storing the template in resources/views/inc

controller looks like this:

$user = User::findOrFail($id);
        $subject = $request->get('subject');       

    $user_message = $request->get('message');

    Mail::send('emails.administrator_message', ['user' => $user, 'user_message' => $user_message,],
         function($m) use ($user, $subject, $user_message)
        {
            
            $m->to($user->email, $user->first)
            ->subject($subject);

        });

dmcglone left a reply on Laravel Mail Seems To Be Broken

It sends if I comment the line out, but not when I remove it. This is crazy!

<div class="container">
    <div class="col-md-12">
        <div class="col-md-6">{!! Html::image('images/header2.png') !!}</div>

        <!--<div class="col-md-12">@include('inc.nav')</div>-->
    </div>
    <div class="col-md-12">
        @yield('content')
    </div>    
  </div>

dmcglone started a new conversation Laravel Mail Seems To Be Broken

Hi all,

I'm still baffled with Laravel's e-mail. if I remove the navbar from the e-mail template, it will not send and receives, but it sends fine with the navbar.

with the navbar the e-mail sends and receives with no problem

<div class="container">
    <div class="col-md-12">
        <div class="col-md-6">{!! Html::image('images/header2.png') !!}</div>
        <div class="col-md-12">@include('inc.nav')</div>
    </div>
    <div class="col-md-12">
        @yield('content')
    </div>
 </div>

but if I remove the navbar, it seems to send, but I never receive the message

<div class="container">
    <div class="col-md-12">
        <div class="col-md-6">{!! Html::image('images/header2.png') !!}</div>
      </div>
    <div class="col-md-12">
        @yield('content')
    </div>
 </div>
24 Nov
3 years ago

dmcglone left a reply on Too Much Text And Email Will Not Send

Guys, this has become a nightmare. I've ran into some crazy things. I'll try my best to explain

I removed the image upload from the project and uploaded the site to my hosting account to see if it was my local server causing the problems mentioned above and I seem to be getting the same behavior without an image and only the text "hello". So that ruled out size limits.

With that being said, below is the block of code, which works just fine on my local server, but not on the hosting server. But the block following this one shows what I had to do to get it to work on my hosting server.

$user = User::findOrFail($id);
        $subject = $request->get('subject');
        $user_message = $request->get('message');

        Mail::send('emails.administrator_message',
            ['user' => $user, 'user_message' => $user_message],
            function ($message) use ($user, $subject, $user_message)
            {
                $message->to($user->email, $user->name)
                    ->subject($subject);
            });

With this code, I have to hard code the e-mail address in the $message-> to field, to receive the e-mail.

       $user = User::findOrFail($id);
        $subject = $request->get('subject');
        $user_message = $request->get('message');

        Mail::send('emails.administrator_message',
            ['user' => $user, 'user_message' => $user_message],
            function ($message) use ($user, $subject, $user_message)
            {
                $message->to('david.mcglone1972@gmail.com', 'David')
                    ->subject($subject);
            });

I'm wondering if the difference of PHP versions on my server and the hosting provider is the problem My Server is running PHP 5.6.4 Hosting Server is running PHP 5.4.33

Anyone think the versions could be the culprit? Or is it my code?

23 Nov
3 years ago

dmcglone left a reply on Too Much Text And Email Will Not Send

@bashy just signed up for an account, I'll give that a jab this evening and see what comes of it.

dmcglone left a reply on Too Much Text And Email Will Not Send

I'm running Laravel locally, but using google's smtp servers.

22 Nov
3 years ago

dmcglone started a new conversation Too Much Text And Email Will Not Send

I've been playing around with sending E-Mail with Laravel and when I paste 1 paragraph of Lorem Ipsum into the message, the e-mail sends but never arrives, but if I type a half a sentence it arrives. This happens with or without an attachment. What could cause this?

$user = User::findOrFail($id);
        $subject = $request->get('subject');
        $user_message = $request->get('message');
        $fileAttachment = $request->file('fileAttachment');

        Image::make($fileAttachment->getRealPath())->resize(200, 200)->save($fileAttachment);

        $fileAttachment->move(public_path('tmp/'), $fileAttachment->getClientOriginalName());

        Mail::send('emails.administrator_message',
            ['user' => $user, 'user_message' => $user_message, 'fileAttachment' => $fileAttachment],
            function ($message) use ($user, $subject, $user_message, $fileAttachment)
            {
                $message->to($user->email, $user->name)
                    ->subject($subject);
            });

        dd($fileAttachment);
20 Nov
3 years ago

dmcglone left a reply on Form Attachment Failed To Open Stream

@thomaskim I wanted to thank you for the help. I learned a bit from this, and that's always a good thing.

19 Nov
3 years ago

dmcglone left a reply on Form Attachment Failed To Open Stream

Spoke too soon. I was looking in the wrong tmp directory.

Break time!

dmcglone left a reply on Form Attachment Failed To Open Stream

Well I can't stop laughing. After I fixed the code to upload the file first, I sent a screenshot of the failed email to myself and I received the email, but thought it failed Hahaha.

I think I'm officially burnt out, but on the bright side, the file wasn't saved to the /tmp directory I specified, so I guess my previous message is irrelevant. :-)

dmcglone left a reply on Form Attachment Failed To Open Stream

I understand now. Thank you. I forgot to build the brick before trying to use it. But in my defense laravel has simplified so many things, It seems I was expecting it to magically do it. lol

I did a quick mockup using

{!! $message->embed('images/' . $fileAttachment->getClientOriginalName()) !!}

And it works beautifully. My concern now is, the file will be temporary, do you know a good place to read up on how to accomplish something like that? My thought would be to hit it with a delete method after the email has been sent. What do you think?

dmcglone left a reply on Form Attachment Failed To Open Stream

Thank you, that was the problem. Now the image sends, but the e-mail now contains 1 broken icon and an application/octet-stream icon that contains the image when clicked on. Do I have to specify the mimetype?

Here's the code

Form:

 {!! Form::model($user, ['method' => 'PATCH', 'action' => ['MessagingController@update', $user->id], 'files' => true]) !!}

        {!! Form::label('Subject') !!}
        {!! Form::text('subject', null, ['class' => 'form-control','required' => 'required']) !!}

        {!! Form::label('Message') !!}
        {!! Form::textarea('message', null, ['class' => 'form-control','required' => 'required']) !!}

        {!! Form::label('File') !!}
        {!! Form::file('fileAttachment', null, ['class' => 'form-control']) !!}

        {!! Form::submit('Send Message', array('class' => 'submit-push-right')) !!}
        {!! Form::close() !!}
$user = User::findOrFail($id);
        $subject = $request->get('subject');
        $user_message = $request->get('message');
        $fileAttachment = $request->file('fileAttachment');

        Mail::send('emails.administrator_message',
            ['user' => $user, 'user_message' => $user_message, 'fileAttachment' => $fileAttachment],
            function ($message) use ($user, $subject, $user_message)
            {
                $message->to($user->email, $user->name)
                    ->subject($subject);
            });

       dd($fileAttachment);

template to be sent

<img src="{!! $message->embed($fileAttachment) !!}"/>

18 Nov
3 years ago

dmcglone left a reply on Form Attachment Failed To Open Stream

Thanks @thomaskim for the response. When I change to the file method, dd returns null, but if I use get, dd returns the image name. Any idea why that would happen?

dmcglone started a new conversation Form Attachment Failed To Open Stream

Hi everyone, I've built an email form and it all works, except for when I add the option to attach a file using a form. I can easily attach a file if I specify the actual file in the img tag, but I have no clue why it will not work when I change to using a form.

"fopen(fileAttachment): failed to open stream: No such file or directory"

I can't figure out why it can't open the file.

This is the code I have


        {!! Form::label('File') !!}
        {!! Form::file('fileAttachment', null, ['class' => 'form-control']) !!}

$user = User::findOrFail($id);
        $subject = $request->get('subject');
        $user_message = $request->get('message');
        $fileAttachment = $request->get('fileAttachment');

        Mail::send('emails.administrator_message',
            ['user' => $user, 'user_message' => $user_message, 'fileAttachment' => $fileAttachment],
            function ($message) use ($user, $subject, $user_message, $fileAttachment)
            {
                $message->to($user->email, $user->name)
                    ->subject($subject);
            });
</p><img src="{!! $message->embed('fileAttachment') !!}"/>

15 Nov
3 years ago

dmcglone left a reply on Update Contact Project Pivot Table Using Relationship.

@4xjbh the reason I asked is because I thought you joined your tables onto themselves and became curious, but then I realized you didn't say which model your joins were in. I'm still learning, but am I thinking correct?

14 Nov
3 years ago

dmcglone left a reply on Update Contact Project Pivot Table Using Relationship.

Does a contact belong to a project or does a project belong to a contact?

dmcglone left a reply on Stripe Get And Post Routes

It's no biggie, I understand how it all works, I'll just have to remember it doesn't work on / lol

He might, unless he's Superman. ;-)

dmcglone left a reply on Stripe Get And Post Routes

I just tried using named routes to try and trick it, but that doesn't work either. Seems no matter what is tried, it refuses to post to "/".

I'm still curious why, but I guess I'll move on to something else for the time being.

dmcglone left a reply on Stripe Get And Post Routes

No, It's a completely fresh install with nothing changed and nothing added except for stripe and the post route.

13 Nov
3 years ago

dmcglone left a reply on Stripe Get And Post Routes

The only thing that was different from his video that I was doing was he used "buy" as his view page:

Route::get('buy', function() {
    return view('buy')
});
Route::post('buy',function() {
    dd(Input::all())
});

But I was just being lazy and really didn't think it would make a difference so I stuck with the default root view like so:

Route::get('/', function() {
    return view('welcome')
});
Route::post('/',function() {
    dd(Input::all())
});

But for some reason it wasn't returning the input data to the page, so after an hour or 2 of comparing my work to the video, I decided to change the views to match his and it worked.

I then changed the view to "billing" and a couple other names and they worked also.

Finally, I changed it back to "/" just to see if I wasn't going crazy and sure enough it didn't work...

It's a fresh install of laravel too, with nothing except the default welcome pages.

Isn't that weird? In my mind "/" should work just as well as the other pages.

dmcglone left a reply on Stripe Get And Post Routes

I'm not using anything special, just following the tutorial. I find it weird, that it doesn't work on the root directory.

dmcglone started a new conversation Stripe Get And Post Routes

I've been playing around with stripe today and was following Jeffrey's "billing with stripe" series and I come across something I'm curious about..

If I use "/" in my routes instead of "buy" like Jeff does, the code doesn't work, but if I change the routes to anything other than, it works. Anybody know why this is?

Doesn't work

Route::get('/', 'WelcomeController@index');
Route::post('/', 'WelcomeController@store');

But this works.

Route::get('billing', 'WelcomeController@index');
Route::post('billing', 'WelcomeController@store');
12 Nov
3 years ago

dmcglone left a reply on Simple GitHub Deploy Strategy

After you push to github, ssh into your server and set up git on your server and pull the project from github to the server.

If your looking for an automatic way to pull to your server from github, you could always set up a cron job.

dmcglone left a reply on Prevent Sweet Alert From Loading On Refresh.

Not at the moment, although I did think about it, but couldn't think of a condition to compare it to.

11 Nov
3 years ago

dmcglone left a reply on Laravel Check If Cookie Exists And Get Cookie Data

After deleting all cookies, on the first refresh, no cookie is created, on second refresh cookie is created.

public function index(Request $request)
    {
        $response = new Response('Cookie Now Exist');
        $response->withCookie(cookie('My_Cookie', '8600', 15));

        if (! $request->cookie())
        {
            return "Cookie Doesn't exist";
        }
            return $response;
    }

dmcglone left a reply on Setting Environment Variable Inside Test?

I'm not sure how you would go about testing it with PHPUnit. :-(

dmcglone left a reply on Setting Environment Variable Inside Test?

Forgive me, I was thinking of Requests!

dmcglone left a reply on Setting Environment Variable Inside Test?

You should be able to pass your middleware as an argument

10 Nov
3 years ago

dmcglone left a reply on Laravel 5 Built-in Server Not Serving Images

Check your source and see if the link is looking where it should be.

dmcglone left a reply on Error: "Controller Not Defined" ... But I Am Staring Right At It

I just created a App/Controllers/Test/TestController.php

<?php namespace App\Http\Controllers\Test;

use App\Http\Requests;
use App\Http\Controllers\Controller;

use Illuminate\Http\Request;

class TestController extends Controller {

    public function index()
    {
        return "hello world";
    }

Then added this route:

Route::get('test', 'Test\TestController@index');

And it works, but if I remove either or both Test\ from the route and/or controller I get the same error as you.

Hope that helps.