jlrdw

Experience

137,750

150 Best Reply Awards

  • Member Since 1 Year Ago
  • 52 Lessons Completed
  • 0 Favorites

24th April, 2017

jlrdw left a reply on PDO Timeout With Some Servers • 1 day ago

Is the PDO extension enabled?

jlrdw left a reply on How To Install Laravel On Mediatemple.net • 1 day ago

There's been numerous post on installing to a host, search the forum here, and make sure you install correctly. One article was in https://laravel-news.com

Perhaps https://laravel-news.com/search?q=install will help.

jlrdw left a reply on Count Query • 1 day ago

Did you study the examples at https://laravel.com/docs/5.4/queries#raw-expressions

Like

$users = DB::table('users')
                     ->select(DB::raw('count(*) as user_count, status'))
                     ->where('status', '<>', 1)
                     ->groupBy('status')
                     ->get();

23rd April, 2017

jlrdw left a reply on Ajax Table Update Inserts <br> In Database, Why? • 2 days ago

This is a standalone PHP page why are you doing it in laravel? Is there a more code?

jlrdw left a reply on Database Builder • 2 days ago

View the intro videos, and depends weather you use querbuilder or ORM.

jlrdw left a reply on Displaying Stored Images On Shared Hosting • 2 days ago

<?php if (empty($row->dogpic)) { ?>
                        <td class="imgtd">&nbsp;</td>
                    <?php } else { ?>
                        <td class="imgtd"><a href="<?php echo DIR . 'dog/view?dogid=' . $row->dogid; ?>"><img src="<?php echo DIR . 'upload/imgdogs/' . $row->dogpic; ?>" alt="" class="image"></a></td>
                    <?php } ?>

jlrdw left a reply on Seperating Html File And Laravel Framework • 2 days ago

Have you even considered viewing some of the free intro videos?

22nd April, 2017

jlrdw left a reply on Deploy Without Surprizes • 3 days ago

Pushing your files over does make sense and sounds like you are smart enough to have good backups so many people don't.

20th April, 2017

jlrdw left a reply on How To Move Laravel 5.4 Application To Shared Hosting? • 5 days ago

Did you search this forum as it has been answered already. https://laravel-news.com/subfolder-install

Right in laravel news.

jlrdw left a reply on Is It Possible To Connect Two Database Table Rows? • 5 days ago

@willvincent agreed I don't fully understand OP's reason, but a good use case is a checkbook program, where after it's balanced the cleared transactions are deleted. I however have a backup table to archive every checkbook transaction. Normally a company wants all previous transactions saved.

Maybe this is the reasoning. But there are so many ways to achieve this.

jlrdw left a reply on Laravel IDE • 5 days ago

And to follow up, a while back there was a post where someone made a code generator for laravel, sorry I don't remember the post title. So if code generation is what you are after, it exist already.

jlrdw left a reply on Laravel IDE • 5 days ago

I have programmed in asp.net, tried the mvc, did not like the "no control" on the generated code. I just used razor and wrote my own classes. Laravel leaves full control to the developer.

jlrdw left a reply on How To Store Time, And Manipulate It -- Not Time Travel Related ;) • 5 days ago

The time has to do with task, so probably in the task table or a sub table to task if you do the relations like that, i.e., sub task.

jlrdw left a reply on How To Store Time, And Manipulate It -- Not Time Travel Related ;) • 5 days ago

Have you looked at carbon?

jlrdw left a reply on Is It Possible To Connect Two Database Table Rows? • 5 days ago

@edoc that sounds even better than the above answer I said was intelligent. Torn between two answers!

jlrdw left a reply on Is It Possible To Connect Two Database Table Rows? • 5 days ago

An example trigger

DELIMITER $$

DROP TRIGGER /*!50032 IF EXISTS */ `petback2`.`trzeronull`$$

CREATE
    /*!50017 DEFINER = 'root'@'localhost' */
    TRIGGER `petback2`.`trzeronull` BEFORE INSERT ON `petback2`.`pets` 
    FOR EACH ROW BEGIN
IF NEW.ownerid = 0 THEN
    SET NEW.ownerid = NULL;
END IF;
END;
$$

jlrdw left a reply on Is It Possible To Connect Two Database Table Rows? • 5 days ago

If you want to make this part of the insert/update process, you can create a trigger in the database.

A very sound and intelligent answer indeed.

19th April, 2017

jlrdw left a reply on How To Add Content From Database To A Modal • 6 days ago

If jquery just call route normal way

$(function () {
    function makeAJAXRequest (text) {
        $.ajax({
            url: '<?php echo DIR . "owner/getowner"; ?>',   ////HERE
            type: 'GET',
            dataType: 'json',
            data: { id: text },
            success: processSuccess
        });
    }

Don't use DIR, that's a constand I derived for my app.

But you can use the php tags like that in javascript.

jlrdw left a reply on How To Add Content From Database To A Modal • 6 days ago

What js library are you using?

jlrdw left a reply on How To Add Content From Database To A Modal • 6 days ago

Put the content in a div and display it in your modal.

18th April, 2017

jlrdw left a reply on Approving And Disapproving An Application In Laravel • 1 week ago

It's call a checkbox.

jlrdw left a reply on Storing Returned Results From Database In Array And Pass It To View • 1 week ago

Version 5.2 has a tutorial right in the docs, also on github. You need to download and study that tutorial.

17th April, 2017

jlrdw left a reply on Convert To Eloquent • 1 week ago

On tablet now not desktop but in the doc

You may also access the raw, underlying PDO instance using the getPdo method on a connection instance:

$pdo = DB::connection()->getPdo();

And the parentheses you can prepare and other things it's just basically using PDO.

On a fetch method you have to use a backslash in front of PDO like \PDO.

jlrdw left a reply on How To Remove Public From Laravel 5.4 • 1 week ago

@Imamul.Hossain installing laravel as in that link should get you all fixed.

jlrdw left a reply on Convert To Eloquent • 1 week ago

Why would you mess with raw when you can use getPdo ()? Unless you mean use query as is.

jlrdw left a reply on How To Remove Public From Laravel 5.4 • 1 week ago

For crying out loud, I gave a link that has step by step instructions, really?

jlrdw left a reply on Downgrade PHP From 7.1 To 7.0 On Digitalocean • 1 week ago

@dascorp glad you got it worked out, for the most part anyway.

jlrdw left a reply on Use A Getter-and-setter-in-one Method • 1 week ago

This

protected function getName()
    {
        return $this->name;
    }

    protected function setName($name)
    {
        $this->name = $name;
    }

I wouldn't mess with, I only use getter / setter when I am doing something to the input. Like taking a value and adding 5% to it. (just example)

But there are no hard rules, using a getter and setter or just a getter that handles both works.

jlrdw left a reply on Downgrade PHP From 7.1 To 7.0 On Digitalocean • 1 week ago

@dascorp if you have a real production site make another note, lag 2 versions behind. Most enterprise including State Governments don't update to the latest thing. They lag back several months to ensure all is ok.

jlrdw left a reply on How To Remove Public From Laravel 5.4 • 1 week ago

@Snapey with all the previous post on proper installation, plus other sites with tutorials like I mentioned above, and people still refuse to do a proper install. Makes you wonder.

16th April, 2017

jlrdw left a reply on How To Remove Public From Laravel 5.4 • 1 week ago

Why can't you just install laravel correctly, I even install this way in development. http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

Main files above htdocs and public in a subfolder under htdocs. I have a production site on godaddy using laravel 5.1. I have never had any problems.

jlrdw left a reply on Show All Users In A Table • 1 week ago

You mean after watching the free intro videos, you have no idea how to do this?

jlrdw left a reply on How To Limit Value Within Foreach Loop? • 1 week ago

Have you tried to use a nested foreach?

jlrdw left a reply on Postgres Support For Temporal Data • 1 week ago

Why wouldn't mysql work using date fields? And for existing data, migrations aren't required. But why wouldn't they work.

jlrdw left a reply on Public_html • 1 week ago

I wonder why with laravel you can create seperate the framework and public_html folder for frontend seperately. I wonder how you code it?

You "point" to where main laravel is via resolving paths.

jlrdw left a reply on Laravel 5.4 Get 'param' From Validator: /{param}/page?param2='value' ? • 1 week ago

Are you using GET or POST request?

jlrdw left a reply on How To Return Nested Objects Using Eloquent Or Query Builder • 1 week ago

You don't search for an answer of this sorts, you write a query, and tweak it till it's right. See as example how a complex query was worked out. https://laracasts.com/discuss/channels/eloquent/orderby-computed-related-attribute

jlrdw left a reply on How To Return Nested Objects Using Eloquent Or Query Builder • 1 week ago

You should view some of Jeffrey's videos on relations.

jlrdw left a reply on Bluehost With Shared Hosting Plan • 1 week ago

I have a 5.1 project on godaddy. You need to check if bluehost meets the laravel version you are using requirements.

15th April, 2017

jlrdw left a reply on How To Make Global Or Universal Accessor To All The Attributes Of A Model In Laravel 5.4 ? • 1 week ago

return is_null($value) ? '' : $value;

I don't understand the question, the above works. Just make yourself a helper class, and add that method to it.

jlrdw left a reply on Getting A Checkbox Checked • 1 week ago

You have to "test" if it's true or false, 0 or 1. If true or 1 check it in code.

jlrdw left a reply on A Glorious Return To Vanilla JS • 1 week ago

@endian bookmarked, will look over soon.

jlrdw left a reply on A Glorious Return To Vanilla JS • 1 week ago

@endian have you considered putting any of your code on github? It would make excellent learning material.

Site note, back in 2002 I was using raw js, and writing ajax the long way, that's the main reason I liked jquery when I discovered it, those ajax shortcuts were great and time saving.

jlrdw left a reply on A Glorious Return To Vanilla JS • 1 week ago

@endian I include the jquery library, and "old school" I don't have huge js files, rather I only use the code I need on that page. An example here I only need a popup calandar.

<script>
    $(document).ready(function () {
          $("#odate").datepicker({
            showOn: "button",
            buttonImage: "/crudv22/public/overcast/images/calendar19.gif",
            buttonImageOnly: true,
            dateFormat: "yy-mm-dd",
            changeMonth: true,
            changeYear: true
        });
    });

</script>       

Unlike some folks, I don't load 10 million lines of js code if I only need 20 lines on a page.

Edit Your Profile
Update

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