jlrdw

Experience

174,110

195 Best Reply Awards

  • Member Since 2 Years Ago
  • 66 Lessons Completed
  • 0 Favorites

27th July, 2017

jlrdw left a reply on Is Session Active • 9 hours ago

@Marins an equally important question is where is the user logged in at.

If just a forum, blog site, etc you really have no way of forcing the user to hit log out

But if in a big company, or a State Government that user better log out.

In the State of Texas, Dept of Human resources it's State law to log out. If you don't you are subject to possible jail time and a hefty fine. You can verify this for yourself. The system deals with medical, thus very strict.

Why are you needed to know?

jlrdw left a reply on Development Workflow • 9 hours ago

  • Put fingers on key board and code
  • learn how to setup laravel correctly in production
  • Main laravel goes above htdocs
  • good idea to setup like that in development also, correct

If using ftp see these guides

https://laravel-news.com/subfolder-install (laravel news)

http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/

if using git, forge, etc watch the forge video series.

If you get stuck, at least try, and ask here showing code toy have tried.

  • Don't get over laravelmatized, remember it's a php framework.
  • Understand the orm converts to normal pdo / query at runtime.
  • So realize not every situation is suited for orm.
  • Please still apply common sense.

I like drawing out what forms will look like with yes peccil and paper to make sure customer is happy with field placement.

jlrdw left a reply on How To Return One Row From BelongsToMany ? • 10 hours ago

When using the ORM, and the resultset is tiny, a blog, then nested foreach loops are fine

billy bob trucking
          billy bobs receivables here if not many
gonzales supply
          gonzales receivables here if not many
sally maes drug store
          sally maes receivables here if not many
           

BUT if you had

billy bob trucking
          billy bobs receivables (thousands)
gonzales supply
          gonzales receivables (maybe 2 or 3)
sally maes drug store
          sally maes receivables (several thousand)

          ///( really huge company)
           

So eager loading and orm is a no no. But this works

billy bob trucking
          query and paginate right here billy bobs receivables
gonzales supply
          query and paginate right here gonzales receivables
sally maes drug store
          query and paginate right here sally maes receivables
        

Of course better to deal with one company at a time if viewing on computer. If printed report, all together different.

So a header with whatever info at top

Then maybe a div with the images paginated. Or if a package then whatever method probably ajax.

A good read on has many stuff

http://laravel.io/forum/05-12-2015-has-many-through-relationship-depth

jlrdw left a reply on How To Return One Row From BelongsToMany ? • 10 hours ago

Pics------------history------------art-----------abstract

tree5.jpg---------0-----------------1----------------0

boat125.jpg------1------------------0--------------- 1

lighthouse.jpg---1------------------1--------------- 0

Show me images from table xyz where history = 1

or

Show me images from table xyz where art = 1

lighthouse.jpg is in two fields, but won't show twice.

jlrdw left a reply on How To Return One Row From BelongsToMany ? • 10 hours ago

Pics history art abstract

tree5.jpg 0 1 0

boat125.jpg 1 0 1

lighthouse.jpg 1 1 0

Show me images from table xyz where history = 1

or

Show me images from table xyz where art = 1

lighthouse.jpg is in two fields, but won't show twice.

jlrdw left a reply on How To Return One Row From BelongsToMany ? • 10 hours ago

Pics history art abstract

tree5.jpg 0 1 0

boat125.jpg 1 0 1

lighthouse.jpg 1 1 0

Show me images from table xyz where history = 1

or

Show me images from table xyz where art = 1

lighthouse.jpg is in two fields, but won't show twice.

jlrdw left a reply on Return View To TWO Pages (Admin Page & User Page) • 12 hours ago

Or look at the api and see View::make, and learn how it works.

jlrdw left a reply on How To Return One Row From BelongsToMany ? • 12 hours ago

@Snapey I know folks get "wowed" by the orm and the quick -> thing. But I fully understand, in logistics I had sometimes a shipper was the bill to also. Sometimes the shipper and bill to wasn't the same. This is a clear cut case where checkbox would work.

jlrdw left a reply on How To Return One Row From BelongsToMany ? • 12 hours ago

Seems easier to have in pictures table some added category fields, could store as a number. Then the query could return correct images only once, if type 2 called for it will only show once.

Even though that image could be three types, other two types were not queried.

Could even be checkbox data on add form.

jlrdw left a reply on How To Return One Row From BelongsToMany ? • 14 hours ago

i have a Picture, categories and a category_pictures table

You have pictures in two places?

Do you mean like

  • A theme (history whatever)

  • A category under say history

  • The pictures that go with that

  • Put the theme at top in a header tag

  • put category under that header or bold

  • use maybe ajax to display / paginate images.

I'd look at possible a packages that allows clicking through images, there are more than one such package.

Or if not interested in a package with frills, images in a table, or floated div's.

26th July, 2017

jlrdw left a reply on Cancellation • 1 day ago

Have you tried the support link? https://laracasts.com/contact

jlrdw left a reply on Adding Sub-Records On-The-Fly • 1 day ago

See https://drive.google.com/file/d/0B1_PFw--3o74RDFscjluVlBpNWc/view

Basically instead of a dropdown use a table, I usually have inline edit, but to add I have an add section at bottom, just makes more sense. A lot of this is just taking the time to learn things like

  • display:none (when not used)
  • display:block (when needed)

etc

Normally I don't use inline, but this was accounting stuff and they wanted it like that.

View some youtube videos on inline edit and that sort of thing, it takes time to learn, not a 15 minute thing.

jlrdw left a reply on Some Help With Forge Please, Losing My Mind • 1 day ago

Curious, since forge is a bought product, does Taylor offer support, seems he would.

jlrdw left a reply on Some Help With Forge Please, Losing My Mind • 1 day ago

Ok to try to help, I don't use forge, but have you watched the videos on it, could solve the problem.

jlrdw left a reply on Generating PDFs From Laravel Views • 1 day ago

I thought it went without saying, the user could just unzip at their end. But users, we all know. Have you looked at maybe a text format? Might be a lot smaller. Just attach a text file instead of pdf. Just a thought, but interesting problem.

jlrdw left a reply on I Can't Save A Image In Public Path --Can't Write Image Data To Path -- • 1 day ago

How is storage a public path? That path is above www, or htdocs, are you trying to use asset folder?,, I know for a fact this works,

    public function add(Request $request)
    {
        if (isset($_POST['submit'])) {
            echo "made it here";
            $lid = DB::table('dc_dogs')->count();
            $lid = $lid + 1;
            $file = $request->file('ufile');
            $file_name = $file->getClientOriginalName();
            $file_ext = $file->getClientOriginalExtension();

            $fileInfo = pathinfo($file_name);
            $filename = $fileInfo['filename'];
            $newname = $filename . $lid . "." . $file_ext;
            $destinationPath = ASSET . 'upload/imgdogs';
            $file->move($destinationPath, $newname);
            $dogpic = Cln::fixValue($newname);
            $dogname = ucfirst(Cln::fixValue($_POST['dogname']));
            $sex = ucfirst($_POST['sex']);
            $comments = Cln::fixValue($_POST['comments']);
            $adopted = (isset($_POST['adopted']) == '1' ? '1' : '0'); ///added
            $lastedit = date("Y-m-d H:i:s");
            echo "adpt=" . $adopted . "aaa";

            if (!isset($error)) {
                $postdata = array(
                    'dogpic' => $dogpic,
                    'dogname' => $dogname,
                    'sex' => $sex,
                    'comments' => $comments,
                    'adopted' => $adopted,
                    'lastedit' => $lastedit
                );

                DB::table('dc_dogs')->insert($postdata);
            }
        }
        $title = 'Dog add';
        $view = 'dog/add';
        $layout = ViewLayout::getLayout('admin/addtp');
        $content = View::make($view);


        return view($layout)->with('content', $content)->with('title', $title);
    }

ASSET is a constant I made, to store you use a path, but to display via src it's a url. This works for assets folder. A lot of this stuff is just resolving a path correctly

25th July, 2017

jlrdw left a reply on Define A Relationship As A Union • 2 days ago

I have done accounting packages and just use normal pdo for such things, just easier when doing reports. Not exactly sure what you want for an outcome, but see this example I just used the getPdo() in laravel and wrote normal queries.

https://drive.google.com/file/d/0B1_PFw--3o74d3NXc2F4MGFTdmc/view?usp=sharing

jlrdw left a reply on Want To Know About Resposive? • 2 days ago

@Snapey I will be on look out, I guess I need to verify the site is ok first with

https://www.virustotal.com/ and start checking them first, thanks for the heads up.

jlrdw left a reply on Want To Know About Resposive? • 2 days ago

@JeffreyWay do you thank OP was trying to spam or honestly trying to find out about mobile-friendly stuff? As these type of questions has been asked before here.

jlrdw left a reply on Want To Know About Resposive? • 2 days ago

Ok, you know not every little thing has to be fixed. But if you also go to the actual bootstrap site, they give good example of ways to make a site show one way on a desktop and another on a mobile device.

Likewise, some stuff is common sense, i.e., don't paginate 50, rather on mobile limit to around 10. Optimize images for web, stuff like that.

jlrdw left a reply on Want To Know About Resposive? • 2 days ago

What do you mean?

jlrdw left a reply on Want To Know About Resposive? • 2 days ago

Learn about media queries, and check the google mobile friendly test site. It explains a lot.

jlrdw left a reply on L5.4 Bug(?): Passing Optional Parameters To Controllers Doesn't Work • 2 days ago

That's not laravel code, but a similar framework, and yes there is a search route also, it was just a quick example of filling missing parameters with 0.

jlrdw left a reply on L5.4 Bug(?): Passing Optional Parameters To Controllers Doesn't Work • 2 days ago

Ok here another frame but very similar: Study this good

Route::any('dog/indexlist/{search?}/{avail?}', 'App\Controllers\[email protected]');

and

public function search()
    {
        $dogsearch = Cln::fixUrl(Input::get('psch'));
        $aval = Cln::fixUrl(Input::get('aval'));
        return Redirect::to('dog/indexlist/' . $dogsearch . '/' . $aval);
    }

    public function indexList($dogsearch = '0', $aval = '0')
    {

        $dogsearch = ($dogsearch != '0') ? $dogsearch : '';
        $aval = ($aval != '0') ? $aval : '';
        if (isset($_POST['submit'])) {
            $dogsearch = (isset($_POST['psch']) != '') ? $_POST['psch'] : '';
            $aval = (isset($_POST['aval']) != '') ? $_POST['aval'] : '';
        }
        /////// more coe

jlrdw left a reply on Can't Visit Site On Ipad 2 With Safari And Chrome • 2 days ago

@woerdeman@gmail.com you may want to put this under site feedback.

jlrdw left a reply on L5.4 Bug(?): Passing Optional Parameters To Controllers Doesn't Work • 2 days ago

I guess OP isn't even willing to review my reply.

jlrdw left a reply on How To Use Authentication Using Username Instead Of Email • 2 days ago

The reason I do not use the built in Auth, I have my own code I like using, and works good. I did try it out, but mine is just easier yet secure. Learned a bit from Chris Shiflet articles and the OWASP site and stuck with that.

I have two sites with a custom framework that has custom Auth and csrf protection. Just a couple tweaks in error handling made the custom framework php 7 compatible.

And I do not need to worry about htmlentities like I know blade does, I have a far better solution

public static function fixValue($rvalue)
    {
        $rvalue = empty($rvalue) && !is_numeric($rvalue) ? NULL : trim(strip_tags($rvalue));
        return $rvalue;
    }

Yes I just strip tags, done. Of course these sites don't store any html. If I had to to that I'd probably use a class like http://htmlpurifier.org/.

jlrdw left a reply on How To Pass Checkbox Value 0 If Not Checked And 1 If Checked. • 2 days ago

I don't like the array approach, I like just dealing with individual checkbox data, one at a time - just habit.

jlrdw started a new conversation Guides Dot Not Show Up In Search • 2 days ago

I noticed when searching the forum, a Guide topic isn't in the search results. I put in exact text from a guide but other items were there but not the one from the guide.

jlrdw left a reply on Is It Possible To Integrate Biomatric Attedence System In Laravel? • 2 days ago

@vipin93 are you kidding, with the enhancements Taylor has done to Laravel, I had it mowing my grass the other day. Just kidding.

jlrdw left a reply on Generating PDFs From Laravel Views • 2 days ago

If size is a problen, have you considered zipping it? Zip and un-zipping is pretty standard. I send several several monthly reports via email zipped. Sorry, not in laravel though.

jlrdw left a reply on How To Pass Checkbox Value 0 If Not Checked And 1 If Checked. • 2 days ago

So much easier not to mess with hidden, just deal with a 0 or 1.

  • 0 if nothing was passed
  • 1 of course if passed.

But really all this over a simple checkbox.

jlrdw left a reply on How To Pass Checkbox Value 0 If Not Checked And 1 If Checked. • 2 days ago

If not checked, nothing is passed: SO

$adopted = (isset($_POST['adopted']) == '1' ? '1' : '0');

something like that.

jlrdw left a reply on How To Use Authentication Using Username Instead Of Email • 2 days ago

From the laravel 5.4 documentation:

Username Customization

By default, Laravel uses the email field for authentication. If you would like to customize this, you may define a username method on your LoginController:

public function username()
{
    return 'username';
}

24th July, 2017

jlrdw left a reply on Upgrade To 5.3 • 3 days ago

@coldpizza I wouldn't worry about the upgrading so often, there are still older 4.2 sites in production. I'd explain all to customers up front, and let them choose to stay up to date or not.

Eventually though there's a forced update if a host no longer supports a certain php version. Most host will hold on to an older version for a while longer due to so many production sites. There hopefully security is up to date.

jlrdw left a reply on Upgrade To 5.3 • 3 days ago

I just went from 5.1 to 5.4, now there's a web folder for web routes, really took no time to do some simple cut / paste. I didn't upgrade, I just installed fresh and worked code over. It can be a 2 or three day process.

The trick to it is learn about a newer version prior to using it, make migrating stuff easier.

jlrdw left a reply on How To Make Validation Rules To Upload Pdf, Doc And Docx Files In Laravel 5.4 • 3 days ago

Try writing a custom validator (custom class / function) looking for the extension. Remember, everything isn't "out of box".

jlrdw left a reply on Getting "The Bootstrap/cache Directory Must Be Present And Writable" After Each Deployment • 3 days ago

php artisan cache:clear

And make sure folder permission is set correctly.

jlrdw left a reply on Upgrade To 5.3 • 3 days ago

You mean manually type them in or use Artisan? I guess I am old school, I like doing my own. But either way, some routes aren't hard to change in future. example is another framework had

Router::any('admin', 'Controllers\[email protected]');

where later it changed to

Router::any('admin', 'app\Controllers\[email protected]');

just basically a namespace change.

jlrdw left a reply on Laravel 5.4 Blade Multiple Sections • 3 days ago

Actually the docs does pretty good at breaking this stuff down:

https://laravel.com/docs/5.4/blade

And specfically

Including Sub-Views

Blade's @include directive allows you to include a Blade view from within another view. All variables that are available to the parent view will be made available to the included view:

<div>
    @include('shared.errors')

    <form>
        <!-- Form Contents -->
    </form>
</div>

Even though the included view will inherit all data available in the parent view, you may also pass an array of extra data to the included view:

@include('view.name', ['some' => 'data'])

Of course, if you attempt to @include a view which does not exist, Laravel will throw an error. If you would like to include a view that may or may not be present, you should use the @includeIf directive:

jlrdw left a reply on Upgrade To 5.3 • 3 days ago

See https://laracasts.com/discuss/channels/laravel/recommendations-for-upgrade-from-50

And do 3 things before attempting anything:

  • Backup
  • Backup
  • Backup

But to play it safe you could get all working on development, then put on production.

Any questions, see the three rules.

jlrdw left a reply on Laravel 5.4 And Form Arrays • 3 days ago

You have the array data literally get that, put it in a form and then submit a new form. Once you have that data you can pretty much do anything in the world you want to with it.

jlrdw left a reply on Error 404 : Routes Error After Deploying On Hosting • 3 days ago

MAIN LARAVEL goes outside of (www, public_html, htdocs, whatever name), period. For grins, I have never used 5.4, I used 5.1. BUT, I installed 5.4, uploaded to godaddy correctly all works 100%.

jlrdw left a reply on Use Laravel 5 On A Server Subfolder • 3 days ago

This has been answered so many times, see links in this post https://laracasts.com/discuss/channels/general-discussion/remove-public-folder-laravel-54

Edit Your Profile
Update

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