LaravelLover

LaravelLover

Member Since 3 Years Ago

Experience Points
450
Total
Experience

4,550 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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
450 XP
Jan
22
1 month ago
Jan
17
1 month ago
Activity icon

Replied to Laravel Policy "This Action Is Unauthorized." For UserPolicy

@bugsysha Its already set to true.

/**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }
Jan
16
1 month ago
Activity icon

Started a new Conversation Laravel Policy "This Action Is Unauthorized." For UserPolicy

Hello Im having some issues with my user policy..

AuthServiceProvider.php

public function boot() 
{
    $this->registerPolicies();
    Gate::resource('users', UserPolicy::class);
}

UserPolicy.php

    public function update(User $logged_user, User $user)
    { 
        if(!is_admin()) return false;

        $roles_not_allowed = [];
        if(!is_super_admin() && in_array($user->role, $roles_not_allowed))
            return false;

        return $this->hasPermissionsTo('update_user', $logged_user);
    }

UserController.php

public function __construct() {
        parent::__construct();
        $this->middleware('auth');
        $this->authorizeResource(User::class, 'users');
    }

    public function edit(User $user)
    {
        //logic
    }

    public function update(UserValidation $request, User $user)
    {   

       //logic
    }

Route for users

Route::resource('users', 'Admin\UserController');

Only update wont work but create and list works fine.

Sep
11
5 months ago
Activity icon

Replied to UniSharp Filemanager Not Working With Laravel!

I fixed this with the following method..

Went to public folder and delete the "storage" file.

then ran "php artisan storage:link" and it worked!

Sep
09
5 months ago
Activity icon

Replied to UniSharp Filemanager Not Working With Laravel!

No errors on the log bro!

Sep
08
5 months ago
Activity icon

Started a new Conversation UniSharp Filemanager Not Working With Laravel!

Hello Guys

I'm having some issues with laravel 5.8.30 and unisharp file manager 2.0...

I can uploads files and they got to relevant folders but the file manager wont show it in the backend. Manually browsing the images wont show either!

My lfm.php looks something like this..

return [ /* |-------------------------------------------------------------------------- | Routing |-------------------------------------------------------------------------- */

'use_package_routes'       => false,

// // Use relative paths (without domain)
'relative_paths'           => false,

// The url to this package. Change it if necessary.
'url_prefix'               => config('admin.route.prefix') . '/uploads',

/*
|--------------------------------------------------------------------------
| Multi-User Mode
|--------------------------------------------------------------------------
 */

'allow_multi_user'         => false,

'allow_share_folder'       => false,

/*
|--------------------------------------------------------------------------
| Folder Names
|--------------------------------------------------------------------------
 */

// Flexible way to customize client folders accessibility
// If you want to customize client folders, publish tag="lfm_handler"
// Then you can rewrite userField function in App\Handler\ConfigHandler class
// And set 'user_field' to App\Handler\ConfigHandler::class
// Ex: The private folder of user will be named as the user id.
'user_folder_name'         => UniSharp\LaravelFilemanager\Handlers\ConfigHandler::class,

// 'shared_folder_name'       => 'shares',

'thumb_folder_name'        => 'thumbs',

'folder_categories'        => [
    'product'  => [
        'folder_name'  => 'product',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'category' => [
        'folder_name'  => 'category',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'brand'    => [
        'folder_name'  => 'brand',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'vendor'   => [
        'folder_name'  => 'vendor',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'language' => [
        'folder_name'  => 'language',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'currency' => [
        'folder_name'  => 'currency',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'logo'     => [
        'folder_name'  => 'logo',
        'startup_view' => 'grid',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'content'  => [
        'folder_name'  => 'content',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],
    'page'     => [
        'folder_name'  => 'page',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'avatar'     => [
        'folder_name'  => 'avatar',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'other'    => [
        'folder_name'  => 'other',
        'startup_view' => 'grid',
        'max_size'     => 30000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'banner'   => [
        'folder_name'  => 'banner',
        'startup_view' => 'grid',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
        ],
    ],

    'file'     => [
        'folder_name'  => 'file',
        'startup_view' => 'list',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
            'application/pdf',
            'text/plain',
        ],
    ],

    'manager'  => [
        'folder_name'  => '',
        'startup_view' => 'list',
        'max_size'     => 50000, // size in KB
        'valid_mime'   => [
            'image/jpeg',
            'image/pjpeg',
            'image/png',
            'image/gif',
            'image/svg+xml',
            'application/pdf',
            'text/plain',
        ],
    ],
],

/*
|--------------------------------------------------------------------------
| Upload / Validation
|--------------------------------------------------------------------------
 */

'disk'                     => 'public',

'rename_file'              => false,

'alphanumeric_filename'    => false,

'alphanumeric_directory'   => false,

'should_validate_size'     => false,

'should_validate_mime'     => false,

// permissions to be set when create a new folder or when it creates automatically with thumbnails
'create_folder_mode'       => 0755,

// permissions to be set on file upload.
'create_file_mode'         => 0644,

// If true, it will attempt to chmod the file after upload
'should_change_file_mode'  => true,

// behavior on files with identical name
// setting it to true cause old file replace with new one
// setting it to false show `error-file-exist` error and stop upload
'over_write_on_duplicate'  => true,

/*
|--------------------------------------------------------------------------
| Thumbnail
|--------------------------------------------------------------------------
 */

// If true, image thumbnails would be created during upload
'should_create_thumbnails' => true,

// Create thumbnails automatically only for listed types.
'raster_mimetypes'         => [
    'image/jpeg',
    'image/pjpeg',
    'image/png',
],

'thumb_img_width'          => 200,

'thumb_img_height'         => 200,

/*
|--------------------------------------------------------------------------
| jQuery UI options
|--------------------------------------------------------------------------
 */

'resize_aspectRatio'       => false,

'resize_containment'       => true,

/*
|--------------------------------------------------------------------------
| File Extension Information
|--------------------------------------------------------------------------
 */

'file_type_array'          => [
    'pdf'  => 'Adobe Acrobat',
    'doc'  => 'Microsoft Word',
    'docx' => 'Microsoft Word',
    'xls'  => 'Microsoft Excel',
    'xlsx' => 'Microsoft Excel',
    'zip'  => 'Archive',
    'gif'  => 'GIF Image',
    'jpg'  => 'JPEG Image',
    'jpeg' => 'JPEG Image',
    'png'  => 'PNG Image',
    'ppt'  => 'Microsoft PowerPoint',
    'pptx' => 'Microsoft PowerPoint',
],

'file_icon_array'          => [
    'pdf'  => 'fa-file-pdf-o',
    'doc'  => 'fa-file-word-o',
    'docx' => 'fa-file-word-o',
    'xls'  => 'fa-file-excel-o',
    'xlsx' => 'fa-file-excel-o',
    'zip'  => 'fa-file-archive-o',
    'gif'  => 'fa-file-image-o',
    'jpg'  => 'fa-file-image-o',
    'jpeg' => 'fa-file-image-o',
    'png'  => 'fa-file-image-o',
    'ppt'  => 'fa-file-powerpoint-o',
    'pptx' => 'fa-file-powerpoint-o',
],

/*
|--------------------------------------------------------------------------
| php.ini override
|--------------------------------------------------------------------------
|
| These values override your php.ini settings before uploading files
| Set these to false to ingnore and apply your php.ini settings
|
| Please note that the 'upload_max_filesize' & 'post_max_size'
| directives are not supported.
 */
'php_ini_overrides'        => [
    'memory_limit' => '256M',
],

];

any help please?

Aug
29
5 months ago
Activity icon

Replied to Laravel 3 Table Relationship

Thanks @janosk and @punksolid !

That was exactly i was looking for! i used many to many with sync method and works like a charm to add/update

https://laravel.com/docs/5.5/eloquent-relationships#updating-many-to-many-relationships

Really appreciating the community for all the quick helps!

Aug
28
5 months ago
Activity icon

Started a new Conversation Laravel 3 Table Relationship

i need some help with laravel relationship as im bit confused with which relationship to use here..

So i have 3 tables

  1. Roles

i) id ii) name

  1. Permissions

i) id ii) name

  1. role_has_permissions

i) role_id ii) permission_id

Single role can have multiple permissions

how do i manage my relationship for those 3 tables?

Any help is really appreciated!