pauljp

pauljp

Member Since 2 Months Ago

Experience Points
2,730
Total
Experience

2,270 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
18
Lessons
Completed
Best Reply Awards
1
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

Level 1
2,730 XP
Mar
14
2 months ago
Activity icon

Replied to How To Unserialize Data

@david001 seems like an object , and cart seems to have been serialized. can you do a var_dump of it?

if it is an object.. you can do unserialize($object->cart);

Activity icon

Replied to How To Unserialize Data

@david001 right.

  1. Customer Places Order

  2. Info is Stored In DB

  3. You fetch the values

  4. you return your view with variable

    return view('viewName')->with('varaibleName', $variable);

  5. on your view you can: {{ !! $varaibleName !!}

Activity icon

Replied to How To Unserialize Data

@david001 have you tried {!! $data !! } on your view?

Activity icon

Replied to Laravel Session

@shan2590 Sugestions from a noob:

Cron a check logged user and last interaction.

Js countdown with ajax to interact with the backend.

Mar
13
2 months ago
Activity icon

Started a new Conversation Have To Dump-autoload Everytime I Update My Service Container

Hi Guys,

I'm kind of new to Laravel. I've creating a service container, but to test my changes through tinker, I have to dump-autoload through composer.

I read on a different post that I shouldn't need to dump autoload every time. Please help. Thanks!

*** UPDATE *** : i just realized i have to dump-autoload only when testing in tinker, but through browser no issues. Wrong tinker config?

This is my code:

Facade

namespace App;

use Illuminate\Support\Facades\Facade;

class DeptInputFacade extends Facade
{
		protected static function getFacadeAccessor()
	{
    	return 'deptInput';
	}

}

Service Provider:

namespace App\Providers;

use App\DeptInput;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{

		public function register()
		{
    	
    		$this->app->bind('deptInput', function(){
        		return new DeptInput();
    		});
		}

		public function boot()
		{
   			 //
		}
}

SERVICE CONTAINER

namespace App;

class DeptInput { public $registeredInputs;

public function __construct()
{
    $this->registeredInputs = $this->registered_inputs();
}


public function registered_inputs(){

    $inputs = [
        'textarea'  => [
            'name'                  => 'Text Box',
            'description'           => 'Long Text Area',
            'function'              => 'input_textarea',
        ],
        'input'  => [
            'name'                  => 'General Input',
            'function'              => 'input_general',
        ],
        'dropdown'  => [
            'name'                  => 'Drop Down Options',
            'function'              => 'input_select'
        ],
        'checkbox'  => [
            'name'                  => 'Multiple Select Options',
            'function'              => 'input_checkbox',
        ],
        'radio'  => [
            'name'                  => 'Single Select Options',
            'function'              => 'input_radio',
        ],
        'upload'  => [
            'name'                  => 'Upload Files',
            'function'              => 'input_uploads',
        ],
    ];

    return $inputs;
}

		public function get($input_key){

		$inputs = $this->registered_inputs();

		if(array_key_exists($input_key, $inputs)){
			return inputs [$input_key];
		}  else {
			return false;
		}
		}
}
Mar
12
2 months ago
Activity icon

Awarded Best Reply on On Select Drop Down List Fetch Doctors Data.

@raimdanish oh lol.. u don't have "name" attribute on your select element...

Activity icon

Replied to On Select Drop Down List Fetch Doctors Data.

@raimdanish oh lol.. u don't have "name" attribute on your select element...

Activity icon

Replied to Need Help For Force Logout System For My Laravel 6 Project

@alauddinjahin https://stackoverflow.com/questions/37876033/is-it-possible-to-force-logout-using-user-id-in-laravel

follow that.

Your question is kind of weird. So ur a**hole boss wants to control who is logged in or not?

you can just make a route where you can get all currently logged in sessions. and he can have a "kick him out" button

Mar
10
2 months ago
Activity icon

Replied to Sample Code Containing Expression Like {{ $title }} Cause Blank Page In Laravel

" aste the following code in your welcome.blade.php, I suppose you have a list files uploaded, that’s why I’m passing variable $file_name to the route, put the variable $file_name in {{}}. "

So the tutorial assumes you have list of files uploaded. Thats why im askin you to check what $file_name has

before your form you can do a simple:

	{{print_r($file_name)}}

or a

	{{var_dump($file_name)}}

or before you return your route, do a

return dd($file_name)

Activity icon

Replied to Sample Code Containing Expression Like {{ $title }} Cause Blank Page In Laravel

How are u passing $flie_name to your route?? ( return view()->with('file_name', $file_name) ??? )

If so, are you sure $file_name is a string?

do a dd($file_name) to confirm

If $file_name has formatting (which shouldn't if is just a string ) , you can try { !! $file_name !!}

Activity icon

Started a new Conversation Use Relationship Value As Property

I have a one to many relation. The One is a Users Table . and the Many have columns: Id, user_id, value_key, value I'm able to retrieve the relation with no issues but i would like to make it smarter. I would like to make the "value_key" column into properties of the relation. $users->relation->value_key , so it returns the "value" column.

So pretty much assign the value keys as properties for my relation

Atm, my relation returns multiple rows and I have to iterate through every single one to see if a specific value_key exists. I think this will not be efficient if i have to this on my index pagination View.

Any tips how i can achieve this? Thanks!

This is my eloquent call

global $deptModuleId;

    $deptModuleId = $moduleId;

    $query = SELF::
    select('taxonomy_meta.*', 'taxonomy.*')
        ->with(['taxChildren' => function($query){
            global $deptModuleId;

            $query->select('taxonomy_meta.*', 'taxonomy.*')
                ->where([
                    ['module', '=', $deptModuleId ],
                    ['meta_key', '=', 'position'],
                ])
                ->leftJoin('taxonomy_meta', 'taxonomy.id', '=', 'taxonomy_meta.tax_id')
                ->orderByRaw('LENGTH(taxonomy_meta.meta_value)', 'asc')
                ->orderBy('taxonomy_meta.meta_value', 'asc');
        }])
        ->leftJoin('taxonomy_meta', 'taxonomy.id', '=', 'taxonomy_meta.tax_id')
        ->where([
            ['module', '=', $moduleId],
            ['meta_key', '=', 'position'],
        ])
        ->whereNull('parent')
        ->orderByRaw('LENGTH(taxonomy_meta.meta_value)', 'asc')
        ->orderBy('taxonomy_meta.meta_value', 'asc');

    if($withTax == true){
        $query = $query->with('taxMeta', 'taxChildren.taxMeta');
    }

    $departments = $query->get();

    return $departments;