ojthejuice

ojthejuice

Member Since 3 Years Ago

Experience Points 14,565
Experience Level 3

435 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 173
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

31 Jan
2 years ago

ojthejuice started a new conversation 'Where' And 'How' To Save Images

So I have a site where user can upload images. Where and How should I save them. I mean I don't want just anybody(or some script kiddy) to be able to access them. I don't want to save them in a database either. I need ideas. So what is the standard.

Thanks

12 Apr
3 years ago

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

Still littering the forum with worthless comments, huh.

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

@willvincent, I see you don't get. So i'm going to say thanks for setting my expectations. I HAD NO idea there wasn't a easy button involved in the process. Now I would like to get back on topic. So I did create artisan command script and setup the remote cli configuration so that I can debug it. That works well. But it still don't answer the initial post. So, if anyone else would like to help. I'm welcome for suggestions. Even @willvincent, I would welcome any comment or suggestion you have also.

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

I know your trying to help, and i give you much thanks. But as I mentioned earlier. I was trying to avoid the command scripts. I believe trying to convince me to use them and giving a life lesson is uncalled for. Even the suggestion about using the command script was welcomed by myself. But the life comment I didn't take it well. I know I will have to do my bit of research also, I posted here. Because I thought someone else my have experienced it, and it would be quicker. That's it. I'm not here for smart rhetorical comments like so many tech forums are littered with. I have been impressed by the comments and help given in forum. And I would like it stay that way. That uncalled for comment of mine, was kinda of me saying "Please Leave, Take that garbage elsewhere"

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

NO, It sounds like. I wanted to do it a way YOU ALSO don't know how to do it. If you don't know, you don't know. I posted this for help. I really appreciate your comments but the last one was unnecessary.

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

Yeah, i was trying to avoid all of that. I had the most trouble setting that stuff up with: different phpstorm, php versions, and different environments. Its just a hassle. I really wanted to find out a way to do one off scripts, setup a debug configuration in phpstorm and done with it. I have another idea that knowing this would be handy down the road. Thanks, I guess the command script will have to work for now.

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

But how do I debug it. I created an artisan command the other day. I like it but, honestly I dont know how to debug it. That probably a simple question, lol.

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

Yeah, homestead. I cut the code and put it in a controller and setup a route and it works fine. ran it from a browser it works fine.

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

Can I do something like a composer update or optimize or reload or something. kind of new to composer.

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

<?php
require dirname(__DIR__) . '/vendor/autoload.php';
require dirname(__DIR__) . '/bootstrap/app.php';

use CureHS\Meal\Description as Description;

class PopulateMealDescriptions
{
    private $generalFoods = [
        'asparagus',
        'apples',
        'avacado',
        'alfalfa',
        'acorn squash',
        'almond',
        'arugala',
        'artichoke',
        'applesauce',
        'asian noodles',
        'antelope',
        'ahi tuna',
        'albacore tuna',
        'Apple juice',
        'Avocado roll',
        'Bruscetta',
        'bacon',
        'black beans',
        'bagels',
        'baked beans',
        'BBQ',
        'bison',
        'barley',
        'beer',
        'bisque',
        'bluefish',
        'bread',
        'broccoli',
        'buritto',
        'babaganoosh',
        'Cabbage',
        'cake',
        'carrots',
        'carne asada',
        'celery',
        'cheese',
        'chicken',
        'catfish',
        'chips',
        'chocolate',
        'chowder',
        'clams',
        'coffee',
        'cookies',
        'corn',
        'cupcakes',
        'crab',
        'curry',
        'cereal',
        'chimichanga',
        'dates',
        'dips',
        'duck',
        'dumplings',
        'donuts',
        'eggs',
        'enchilada',
        'eggrolls',
        'English muffins',
        'edimame',
        'eel sushi',
        'fajita',
        'falafel',
        'fish',
        'franks',
        'fondu',
        'French toast',
        'French dip',
        'Garlic',
        'ginger',
        'gnocchi',
        'goose',
        'granola',
        'green beans',
        'Guancamole',
        'gumbo',
        'grits',
        'Graham crackers',
        'ham',
        'halibut',
        'hamburger',
        'honey',
        'huenos rancheros',
        'hash browns',
        'hot dogs',
        'haiku roll',
        'hummus',
        'ice cream',
        'Irish stew',
        'Indian food',
        'Italian bread',
        'jambalaya',
        'jelly jam',
        'jerky',
        'jalapeƱo',
        'kale',
        'kabobs',
        'ketchup',
        'kiwi',
        'kidney beans',
        'kingfish',
        'lobster',
        'Lamb',
        'Linguine',
        'Lasagna',
        'Meatballs',
        'Moose',
        'Milk',
        'Milkshake',
        'Noodles',
        'Ostrich',
        'Pizza',
        'Pepperoni',
        'Porter',
        'Pancakes',
        'Quesadilla',
        'Quiche',
        'Reuben',
        'Spinach',
        'Spaghetti',
        'Tater tots',
        'Toast',
        'Venison',
        'Waffles',
        'Wine',
        'Walnuts',
        'Yogurt',
        'Ziti',
        'Zucchini',
    ];

    public function __construct()
    {

    }

    public function addGeneralFoods() {
        foreach($this->generalFoods as $food) {
            $description = Description::where('description', '=', $food)->first();
            if ($description != null) {
               $description->description = ucfirst($food);
            } else {
                Description::create(['description' => $food]);
            }
        }
    }
}

$job = new PopulateMealDescriptions();
$job->addGeneralFoods();

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

I created a ProjectRoot/bin/ScriptName.php. And inside in removed namespace and put

require dirname(__DIR__) . '/vendor/autoload.php';
require dirname(__DIR__) . '/bootstrap/app.php';

sames error as above

Okay this is what I have, and I get a PHP Fatal error: Call to a member function connection() on a non-object in .../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 3224 . . . . PHP 12. Illuminate\Database\Eloquent\Model::resolveConnection($connection = uninitialized) .../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:3190

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

The script is not in the root directory. Im I missing something.

11 Apr
3 years ago

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

I have a folder in the app dir. The full path is app/Application_Helpers/Foo/FooBar/NameOfScript.php

ojthejuice left a reply on One Time Scripts With Access To App Namespaces

Note: Using a homestead enviroment

Okay this is what I have, and I get a PHP Fatal error: Call to a member function connection() on a non-object in .../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php on line 3224 . . . . PHP 12. Illuminate\Database\Eloquent\Model::resolveConnection($connection = uninitialized) .../vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php:3190

<?php
namespace PATH\TO\MY\SCRIPT;

require dirname(__FILE__) . '../../../../bootstrap/app.php';
require dirname(__FILE__) . '../../../../vendor/autoload.php';

use PATH\TO\DESCRIPTION as Description;

class NameOfScript
{
    private $array = [
        'value',
    .
    .
    .
    ];

    public function addGeneralInformation() {
        foreach($this->$array as $data) {
            $description = Description::where('description', '=', $data)->first();
            if ($description != null) {
               $description->description = ucwords($data);
            } else {
                Description::create(['description' => $data]);
            }
        }
    }
}

$job = new NameOfScript();
$job->addGeneralInformation();

ojthejuice started a new conversation One Time Scripts With Access To App Namespaces

Can someone please advise how to create and on time script that has access to all namespaces in my app. I dont want to use artisan console commands. Just a "php myscript.php". I also want to be able to debug it in phpstorm.

20 Aug
3 years ago

ojthejuice left a reply on Set Input Directory For Less Function

I tried that solution and I dont think that works. I edited the less.js file and here was my solution.

start on line 36

/**
 * Prep the Gulp src and output paths.
 *
 * @param  {string|array} src
 * @param  {string|null}  output
 * @return {object}
 */
var prepGulpPaths = function(src, output) {
    //My Hack: if source is directory use it if not use default
    var directory = '';
    if (src.indexOf('/') > -1){
        directory = src.substring(0, src.lastIndexOf('/') + 1);
    } else {
        directory = config.get('assets.css.less.folder');
    }
    return new Elixir.GulpPaths()
        .src(src, directory)
        .output(output || config.get('public.css.outputFolder'), 'app.css');
};

That way i can run this in Gulpfile

//task one
    mix.less(
        'style.less',                    //Less file created in public/css/app.css
        'public/frontend-less/style.css' //Specifies where the combined less file will go
    );

//task two
    mix.less(
        'resources/admin/less/style.less',
        'public/admin/less/style.css'  //Less file created in public/css/app.css
    );

ojthejuice started a new conversation Set Input Directory For Less Function

Is there a way to set the input or root directory for less using elixir. And can i use mix.less twice. i.e

elixir(function(mix) { mix.less( 'style.less', //Less file created in public/css/app.css 'public/frontend-less/style.css' //specifies where the combined less file will go );

//second less task mix.less( '..', //point to different directory '....' //output to different directory );

});

05 Aug
3 years ago

ojthejuice started a new conversation Creating Helper Classes And Functions That I Can Use In The Controller Or Model.

What is the best place or practice to create helper classes/function so I can use them in the controller layer?