dmcglone27

Experience

36,720

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 352 Lessons Completed
  • 6 Favorites

1st November, 2017

dmcglone27 left a reply on Link Anchors Don't Work • 3 weeks ago

I figured this out.. For some reason bootstrap.min.js was causing it. No idea why.

31st October, 2017

dmcglone27 started a new conversation Link Anchors Don't Work • 3 weeks ago

I have a menu that uses anchors which point to various sections of the welcome page, and everything works just fine, until I am on a stand alone page. I can't for the life of me figure out why the links will not work.

my nav

<li><a href="/#meetings">Meetings</a></li>
<li><a href="/#events">Events</a></li>
<li><a href="/gallery">Gallery</a></li>
<li><a href="/#newsletter">Newsletter</a></li>

Every link works fine until I am on the gallery page, then the links will not work at all. I'm at a total loss.

If I put the menu code directly into the gallery page, it doesn't work that way either.

26th October, 2017

dmcglone27 left a reply on SSL On 5.0 • 4 weeks ago

@Cronix Thanks again, it was a link to a weather widget.

dmcglone27 left a reply on SSL On 5.0 • 4 weeks ago

@Cronix that was it.. It's something in my app.blade.php.. I haven't found what it is yet, but I suspect the javascript.

dmcglone27 left a reply on SSL On 5.0 • 4 weeks ago

Hmmm I'll check my code.

dmcglone27 left a reply on SSL On 5.0 • 4 weeks ago

I just uploaded an index.html file to the 5.0 website and the SSL works, so that confirms it is the Laravel installation. Does anyone know what could be causing it?

dmcglone27 started a new conversation SSL On 5.0 • 4 weeks ago

I just set up SSL on a 5.0 and a 5.2 Laravel installation, and on the 5.2 installation everything works just perfectly, but on the 5.0 installation the https URL works, but it still says it's not secure. Is this a problem with my Laravel or should I suspect the installed certificate?

18th October, 2017

dmcglone27 left a reply on Ordering Dates • 1 month ago

Thanks guys, after a long hiatus from Laravel, I forgot a few things, but seeing the examples , refreshed my memory and here is what worked for me.

view()->composer('partials.events', function ($view) {


            $view->with('events', Events::orderBy('date')->where('date', '>=', Carbon::today())->where('archived', false)->limit(3)->get());

        });

17th October, 2017

dmcglone27 started a new conversation Ordering Dates • 1 month ago

Hi all, I'm trying to get 3 dates, but I don't want any date that is more than 2 or 3 days in the past. For example I have Sept 29, 2016, Oct 15, 2017, Oct 16, 2017 and Oct 31, 2017.. All I want is the 15th, 16th and 31st of 2017 what could I do here to accomplish that? I have tried latest(), latest('date', 'asc') but neither work. Suggestions?

view()->composer('partials.events', function ($view) {

            $view->with('events', Events::orderBy('date)->where('archived', false)->limit(3)->get());

1st June, 2017

dmcglone27 left a reply on Is Using .env Or .htaccess On Server Good Or Bad • 5 months ago

I'm sorry, it's /home/username. It's the folder up one level of www or public_html on the server.

dmcglone27 left a reply on Is Using .env Or .htaccess On Server Good Or Bad • 5 months ago

@Snapey I see. So my best bet would be to move .env out of the www folder and into / correct?

@jlrdw I tested this earlier and my app properly displays the 404 error page and not the .env file.

dmcglone27 left a reply on Is Using .env Or .htaccess On Server Good Or Bad • 5 months ago

That appears to be for subdomains. my dir structure is

-www all the Laravel files and folders .htaccess .env .git .gitignore etc...

Should I be putting .htaccess, .env or both in / instead of www?

dmcglone27 left a reply on Is Using .env Or .htaccess On Server Good Or Bad • 5 months ago

Thanks. I was doubting it because of a recent hack and somehow my .htaccess was removed.

dmcglone27 started a new conversation Is Using .env Or .htaccess On Server Good Or Bad • 5 months ago

When uploading a project to a shared server, should I leave the .env file where it is or should it not be used?

8th February, 2017

dmcglone27 left a reply on Getting Date From Db In Different Format • 9 months ago

@mstnorris Yeah I tried that, and then my view would complain it couldn't find ->diffForHumans() etc etc..

But then again I've been at this for about a day, so everything was just jumbled up. But the options @cviv suggested worked perfectly. :-)

dmcglone27 left a reply on Getting Date From Db In Different Format • 9 months ago

Ah Thank you! Worked perfectly. I couldn't find these timepicker options on the web.

Thanks @cviv

dmcglone27 started a new conversation Getting Date From Db In Different Format • 9 months ago

I'm using the bootstrap datepicker, to insert a date into the db, but in order to use carbon, so I convert the date before inserting it into the db using

        $input['date'] = Carbon::createFromFormat('m/d/Y', $request->date)->format('Y-m-d');

My problem is when I go to the edit page, my date field cannot be populated, because the date is a carbon instance, so I'm trying to convert it back to m/d/Y format for editing. here's my form

                {!! Form::text('date', $meetings->date, array('class' => 'form-control', 'input-group date', 'id' => 'datetimepicker', 'required' => 'required')) !!}

I've tried using several ideas

 $meetings->date->format('Y-m-d')
 format('Y-m-d', $meetings->date)

And several other ways.

So how can I get the date in the correct format to populate the field?

3rd January, 2017

dmcglone27 started a new conversation Multiple Social Login And Regular Login • 10 months ago

I've added Socialite to my login page and the default behavior is to only allow the user to consistently log in with the initial method they chose.

So I'm wondering if it's bad or good to allow the user to log in using any method after signing in with a different method they previously chose?

For example a user logs in using facebook then comes back to the site later and forgets they logged in with facebook and tries to log in using google but it will not allow them to log in because their google email is the same as their facebook email and they can't log in using the form provided either.

In my case, if the user forgets, they are left with 4 different guesses, did I log in with fb? did I log in with google? did I log in with linkedin? or did I use the provided form?

How could this scenario be handled?

28th December, 2016

dmcglone27 left a reply on Refactoring • 10 months ago

Yeah It is a simple example, but you answered my question with the perfect answer.. "move them to a helper class". Now I've got something to focus on and practice.

Thanks :-)

Hopefully others will drop a suggestion as well with various other methods if there are any.

dmcglone27 left a reply on Refactoring • 10 months ago

Post verification is like a Nazi here... lol

dmcglone27 started a new conversation Refactoring • 10 months ago

I'm trying to get better at refactoring so I took a simple read directory script and put it directly into my index controller. Now I'm trying to figure out a method to refactor so I can remove the code from the controller and keep it clean. What are my options with Laravel? What method of refactoring would everybody suggest? Here's a quick snip of code I copied from php.net and altered a little for this exercise. Also, this code example doesn't work, I'm just using it as a visual example. With that said, what method should I use to extract this code and clean up my controller?

~~ public function index()

$files = opendir("/"); while (($file = readdir($files)) !== false) { if( ! is_dir($file) && $file != "." && $file != '..' && $file[0] != '.' ) { return the results; } } } ~~

18th December, 2016

dmcglone27 left a reply on Errors • 11 months ago

@clay Ah, that was it!! My routes were not in the middleware group!

Thanks a bunch man!

dmcglone27 left a reply on Errors • 11 months ago

You mean when it fails on submission and returns back?

dmcglone27 left a reply on Errors • 11 months ago

I'm using a request. I've even tried putting the code directly into my view like this

@if (count($errors) > 0) Please correct the following errors:

@endif --

dmcglone27 started a new conversation Errors • 11 months ago

Hey all, I'm trying to figure out why I have access to the errors variable in one project but not the other. I can't recall what I had done in the working project for it to work. Am I missing a package?

The error I get is: Undefined variable: errors

It works with version 5.2.43, but not 5.2.45

Here's the code: http://pastebin.com/M6RYUGK8

30th September, 2016

dmcglone27 left a reply on What Changed In The New Laravel That Effected Update? • 1 year ago

I have solved my mystery.. here's what happened

I started with this:

{!! Form::text('task', $task->taskName) !!}
{!! Form::text('task', $task->description) !!}

Then @rsands brought DB row names to my attention so I fixed it with this:

{!! Form::text('task', $task->taskName) !!}
{!! Form::text('description', $task->description) !!}

Then I realized the description was working, but not the task. Thought I must have missed my fillable field so I checked, but that wasn't it. The problem turns out my row name was wrong it should've been taskName not task.. Grrrrrrrr how did I miss that for so many hours?

{!! Form::text('taskName', $task->taskName) !!}
{!! Form::text('description', $task->description) !!}

Even though this made me look like a complete idiot, I appreciate the help you guys threw my way. I'm probably the only one who makes these type of idiotic mistakes.

dmcglone27 left a reply on What Changed In The New Laravel That Effected Update? • 1 year ago

@Eddie212 When he brought that to my attention, I fixed it, but got the same result, but I think it was just the chain of events that happened that made the first attempt fail, So I agree that was probably the problem all along.

dmcglone27 left a reply on What Changed In The New Laravel That Effected Update? • 1 year ago

Ok I just read everyone's suggestions and went through my code and tried the suggestions, but I was getting the same behavior, so I decided to use a plain html form instead of using Laravel collective and that didn't go well. So I put everything back the way I had it and the damn thing started working..

So I compared my code to what I posted above and there's no difference whatsoever. Now I'm even more intrigued to what happened..

dmcglone27 left a reply on What Changed In The New Laravel That Effected Update? • 1 year ago

No error, it just redirects back with no changes.

29th September, 2016

dmcglone27 started a new conversation What Changed In The New Laravel That Effected Update? • 1 year ago

I'm trying to update a record like I always have and it's doesn't working. I've looked in all my previous projects, and anywhere I can think of for an answer, but for the life of me can't get update to work.

Here's what I got

My form

   {!! Form::model('tasks', ['method' => 'PATCH', 'action' => ['[email protected]', $task->id]]) !!}
         {!! Form::text('task', $task->taskName) !!}
        {!! Form::text('task', $task->description) !!}
        {!! Form::submit('Update') !!}
        {!! Form::close() !!}

Controller

 public function update(Request $request, $id)
    {
        $task = Task::findOrFail($id);
        $task->update($request->all());
        return redirect()->back();
    }

Model


    protected $table = 'tasks';

    protected $fillable = [
        'taskName',
        'description',
        'completed'

This is just simple stuff, but what in the world is going on?

24th September, 2016

dmcglone27 left a reply on Routes In 5.3.10 • 1 year ago

@InaniELHoussain I have that exact route. but if I don't add this route

Route::get('/', '[email protected]');

The index page doesn't work unless I specifically use http://......../tasks

23rd September, 2016

dmcglone27 left a reply on Routes In 5.3.10 • 1 year ago

insert, update and delete work now. good thing I asked, because I was about to ditch Route::resource all together.

dmcglone27 left a reply on Routes In 5.3.10 • 1 year ago

@snapey @InaniELHoussain Ok gotcha. I just made a separate route for /. I misunderstood all that.

dmcglone27 left a reply on Routes In 5.3.10 • 1 year ago

If I do it that way, then / won't work :-/

dmcglone27 started a new conversation Routes In 5.3.10 • 1 year ago

Following Jeff's series on a task app, I started a new project with the new laravel and Route::resource isn't working, i get "page not found" when I visit either the edit page or the show page for individual items, but when I add my own routes it works fine. Is this me or did something change?

Here's my routes file

Route::resource('/', 'TaskController');

I tried:

public function edit($id)
    {
        dd('hello');        
    }

even tried:

public function edit($id)
    {
            $task = Task::findOrFail($id);
            return view('edit', compact('task'));
    }

but if I change my routes to this everything works!

Route::get('edit/{id}', '[email protected]');
Route::get('show/{id}', '[email protected]');

7th September, 2016

dmcglone27 left a reply on Frustrated • 1 year ago

+jekinney Thank you. I think the next thing I need to take a look at in depth is request, to understand it better.

6th September, 2016

dmcglone27 left a reply on Frustrated • 1 year ago

Does it look to you if I'm even doing it correctly?

dmcglone27 left a reply on Frustrated • 1 year ago

I tried save() as well and I get an error

FatalThrowableError in AlbumController.php line 129: Call to a member function save() on string

dmcglone27 started a new conversation Frustrated • 1 year ago

I have no clue why the image name is not being saved correctly. I've tried everything I can find and think of and it just keeps saving it as something like /tmp/398983... It's frustrating not being able to figure out what's going wrong.

This is my update method

public function update(Request $request, $id)
    {
        $album = Album::findOrFail($id);
        umask(0);
        File::cleanDirectory('images/cover_photos/' . $id);
        $imageName = $request->file('album_cover')->getClientOriginalName();
        $request->file('album_cover')->move('images/cover_photos/' . $id, $imageName, 0777);
        $album->update($request->all());
        return redirect()->back();
    }

dmcglone27 started a new conversation GetClientOriginalName Entering Tmp Name In Db • 1 year ago

Hey all, I'm trying to upload an image and enter it's name into the db and everything works well except instead of entering the file name into the db it's putting the /tmp/bla.png into the db when I want the name of the file. I can't figure out why this is doing this. Can anyone see what Is going wrong here? Here's my controller: public function update(Request $request, $id) { $album = Album::findOrFail($id); umask(0); File::cleanDirectory('images/cover_photos/' . $id); $imageName = $request->file('album_cover')->getClientOriginalName(); $request->file('album_cover')->move('images/cover_photos/' . $id, $imageName, 0777); $album->update($request->all()); return redirect()->back(); }

9th August, 2016

dmcglone27 left a reply on Faker Class • 1 year ago

Ah Ok. I was only using this in my Model

protected $fillable = ['body'];

Changing it to this works

protected $table = 'about';

protected $fillable = ['body'];

Thank you very much. :-)

dmcglone27 started a new conversation Faker Class • 1 year ago

I am practicing with seeding data in a db and I have a question, why does the Faker class require the table name to be plural?

I want my table name to be "about" not "abouts"

Is this bad practice

2nd August, 2016

dmcglone27 left a reply on No Page Change • 1 year ago

I Just got out of bed and it's working now. I have no idea what happened. There is no caching I know of because all the page does is display 2 rows from the database.

I was having problems with my Ubuntu changing the BIOS to the wrong date and time by 4 hours, so Carbon wouldn't work correctly, and to fix it I had to change my time zone to somewhere in the middle of the Atlantic Ocean..

It doesn't seem likely, but I think that may have been part of the problem.

dmcglone27 left a reply on No Page Change • 1 year ago

edoc huh?

dmcglone27 started a new conversation No Page Change • 1 year ago

I'm sitting here trying to edit a a blade template and nothing is changing , so I deleted the page and and of course Laravel complained the page didn't exist, so I created it again, but this time I left it completely blank but it's still showing the data from the page I deleted.

I even deleted the routes and the page is still there.

I deleted the method for the page in it's controller and it was still there.

I cleared my cache

I dumped composer and

I did a composer update..

!!!

1st August, 2016

dmcglone27 left a reply on Where Are You All From? • 1 year ago

Columbus Ohio

dmcglone27 left a reply on View Composer • 1 year ago

Oh jeeeez!! Yup that was it... :-/

Thank you very much, you saved me from a couple days of insanity. :-)

dmcglone27 left a reply on View Composer • 1 year ago

Sorry, had to edit it like 10 times because I forgot how to add code to comments. :-/

dmcglone27 left a reply on View Composer • 1 year ago

My javascript is in public/js

I am including it at the bottom of my main layout layout.blade.php like this

layout.blade.php in default layout folder

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

dmcglone27 started a new conversation View Composer • 1 year ago

I can't figure out why my navigation dropdown javascript isn't working when the view is 2 levels deep....... it all works in pages.admin, but not in pages.admin.newsletter. Is this a job for a view composer? I looked at the doc's, but don't quite understand it.

-pages -admin //java works on all views in this folder -newsletter //java doesn't work on any views in this folder

Edit Your Profile
Update

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