engrlaravel

engrlaravel

Member Since 8 Months Ago

Experience Points
1,930
Total
Experience

3,070 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
1
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
1,930 XP
16 Sep
4 days ago

engrlaravel started a new conversation Best Way To Stop Users Directly Access Url

I am using below package in laravel

laravel-permission

If user is login, He can access links of different roles not assigned to him. The only two ways to stop him is

public function __construct()
{
    $this->middleware(['role_or_permission:Admin|HR|HRM']);
}

OR

Route::group(['middleware' => ['role_or_permission:super-admin|edit articles']], function () {

Now the problem is, what if new role or permission created which is not mentioned here??

also you can not mention a long list of roles & permissions one by one.

Is there a better way?

engrlaravel left a reply on Best Way For Sub Apps In Laravel

@martinbean : Yes, till this point is clear. The issue is how we handle company slug in url prefix?

Currently i have below groups in web.php

Route::group(['prefix'=>'admin'],function (){
Route::group(['prefix'=>'candidate'],function (){

Currently my url is

example.com/admin

I need to change to

 example.com/apple/admin
 example.com/apple/candidate

How to prefix company slug ?

15 Sep
5 days ago

engrlaravel left a reply on Stop Users Access Your Pages Directly From Url

@flightsimmer668 @snapey :

1- I did something like this

 @role('HR')
  //show menu links of HR
 @endrole

Above code working fine and showing HR menu only to HR role.

2- Now if a person is login and has link of any other page, he can access that without menu links directly from browser.

Issue: I guess i can not put

if (auth()->user()->hasRole('admin')) {
    return $next($request);
}

in middle ware as there is more than 10 roles not only admin.

engrlaravel left a reply on Stop Users Access Your Pages Directly From Url

@flightsimmer668 : There is some misunderstanding. If user has session(he is logged in in other tab), he can directly access other pages from link.

I need to check on role not login user.

Your answer only show for login or not

engrlaravel started a new conversation Stop Users Access Your Pages Directly From Url

I am using laravel package laravel-permission. I have put checks on menu for different roles & permissions.

BUT now users can access directly from url.

What is the best way to stop all users access from url & apply roles & permissions?

Note: I want to check role & permission NOT Login(if user is Auth or no)

engrlaravel started a new conversation Load Data Which Is Available In Layout File On Each Link/url

I want to show some notifications on header layout file. This data should be available on each link/URL.

what is the best place to get this data & how to pass ?

13 Sep
1 week ago

engrlaravel left a reply on Best Way For Sub Apps In Laravel

@martinbean : I liked your suggestion above. I am following that way to do. I am stuck how i can change customer name to my url.

For example, If martinbean is my customer's company & he access my application, url link will be changed automatically after login for him as below

example.com/martinbean 

If APPLE is my customer so after login his url will be

example.com/apple
11 Sep
1 week ago

engrlaravel left a reply on Best Way For Sub Apps In Laravel

@martinbean : Can you please explain little more, how i can change url based on customer?

Example:

example.com/customer1
example.com/customer2
10 Sep
1 week ago

engrlaravel left a reply on Dynamically Change Url For Each Customer In Laravel

@resin : How i can do it? Can you share some links?

engrlaravel left a reply on Best Way For Sub Apps In Laravel

@sti3bas : I think this will be more complicated for me? i guess that need more time & configurations and i am affraid it will effect my other work. I will see if i can find another easy way

engrlaravel started a new conversation Dynamically Change Url For Each Customer In Laravel

I am using Laravel 5.8.

Suppose my website is www.example.com. If customer register company1 , He & all company users will see url like

www.example.com/company1

Another customer register company2, his all users will see

www.example.com/company2

How i can achieve this dynamically?

By Default, i have below groups

Route::group(['prefix' => 'admin','middleware' => 'auth'], function () {

Route::group(['prefix'=>'admin'],function (){

Route::group(['prefix'=>'candidate'],function (){

and others

engrlaravel left a reply on Best Way For Sub Apps In Laravel

@martinbean : WOW, very good idea. Can you give me little more explanation or document link? also how to load customer routes? what if i want to use the same routes BUT only customer name is different?

engrlaravel left a reply on Best Way For Sub Apps In Laravel

@cruorzy : what is the best option to do it? will subdomain will be ok or www.example.com/randomstring??

If we can handle all this in one instance then ok otherwise we will upload separate website

09 Sep
1 week ago

engrlaravel started a new conversation Best Way For Sub Apps In Laravel

I have developed my website in laravel 5.8 and is deployed on www.example.com It is SAAS application.

Now my client want to give different url for each customer(we will have more than 200 customers).

what is the best way to handle it?

my idea is to create folders (customer1,customer2...) inside laravel and re-upload whole application in each folder?

Note: we already have some groups in routes like www.example.com/admin, www.example.com/candidate etc

Your idea will be appreciated

02 Sep
2 weeks ago

engrlaravel left a reply on Wechat Login In Laravel Website

@sti3bas : Now Issue is it redirects to provider(like wechat). is there anyway it can login without sending users to proviers

engrlaravel started a new conversation Create Dynamic Menu & Menu Items In Laravel

Is there any good practice to create menu dynamically. all menus should be followed by specific roles. How the menu & its links should work?

engrlaravel left a reply on Wechat Login In Laravel Website

@sti3bas : I am confused which one should i use? Wechat web/weixin/weixin web?

engrlaravel started a new conversation Wechat Login In Laravel Website

I have admin application developed in laravel. I want users to login through wechat. Is there any package which support wechat login? i checked this https://github.com/overtrue/laravel-wechat but it give some issues.

Does anyone tried any package for wechat login?

engrlaravel started a new conversation Laravel - Roles & Permission In SAAS

Laravel roles & permission package (laravel-permission) is working fine in application for single company. How we can use it for multiple companies(more than one company)?

1- each company has different users

2- each company has different roles

3- each company has different permission for each role(might be possible)

4- laravel application is same for all companies & hence DB

01 Sep
2 weeks ago

engrlaravel started a new conversation Checking Both Roles & Permission At The Same Time

I am using laravel-permission package. I want to show HR menu only to HR & Admin roles and who has permission to HR menu.

 @role('HR|Admin')
<a href="{{ url('hr') }}">HR Menu</a>
 @endrole

How i can combine permission to above condition?

permission alone i can use like this

@can('edit articles')
  <a href="{{ url('hr') }}">HR Menu</a>
@endcan
29 Aug
3 weeks ago

engrlaravel left a reply on Laravel Permission Package Issue

@janosk : it always go to else statement

28 Aug
3 weeks ago

engrlaravel started a new conversation Laravel Permission Package Issue

I am using this package

laravel-permission

Below code is not working

@hasrole('writer')
I am a writer!
@else
 I am not a writer...
@endhasrole

while this is working

@if($user->hasRole('writer'))

Is there any issue? Has I missed something?

I am following this link https://docs.spatie.be/laravel-permission/v2/basic-usage/blade-directives/

26 Aug
3 weeks ago

engrlaravel started a new conversation Replace All Parameter Variables With Values In String Templates

I have templates for emails, I want to replace all occurrences with variable values in the template. Example:

$template = <p>Hi {applicant_name},</p>
            <br>
            <p>You are welcomed to {org_name}</p>, Your salary is {salary}
            <br>
            <p>
            -<br>{company_name}</p>

I have

 $applicant_name = "John";
 $org_name  = "ITF";
 $salary = 50000
 $company_name = "ABC"

How i can do it in laravel with a single function? I want to replace template of variables with real variable names.

engrlaravel left a reply on How To Check If Variable Is Empty/null/NULL/not Set/0

@petrit so what is a combine expression or function who can handle all these cases?

engrlaravel left a reply on How To Check If Variable Is Empty/null/NULL/not Set/0

@tisuchi : some time it comes from user form, some time in my function. i want to do it in php server side, it is not validation.

is there any function?

engrlaravel started a new conversation How To Check If Variable Is Empty/null/NULL/not Set/0

I know there are many ways like

empty($var)
is_null($var)
isset($var)
if(!$var)

But each one has different purpose. I want to have a combined function in laravel to check all these

Does laravel provide a single function to check all in one?

Need to check all possible like

NULL,null,'',0, undefined , not posted and others
14 Aug
1 month ago

engrlaravel started a new conversation Using UUID Also Keeping Id As Well In Laravel

I have users table with Id primary key. I do not want to change / alter users table but add one more field as uuid and allow users to login based on it. is it possible?

1- is it possible to have both Id (primary key and auto increment) and uuid?

2- can i use uuid in anyother table? other than users table?

3- If we add uuid field as well, will it be possible to login user with that?

engrlaravel left a reply on Multiple Emails In Laravel

@bobbybouwmann I got few questions:

1- When user click button, he has to wait till all emails sent? or it will be done in background?

2- Will it slow down the website? user can freely browser other functions?

3- Can i use scheduling? https://laravel.com/docs/5.8/scheduling

4- which one is better option? scheduling or queue?

5- Queue can be used with MySql?

engrlaravel started a new conversation Multiple Emails In Laravel

In my SaaS application, I want to send email to more than 20 users at one button click. First i save data in DB and then sending them emails. Currently i am using laravel builtin function. It takes too much time.

   Mail::send

What is the best option to send multiple emails? any suggestions?

1- Do i need to create cron jobs to send emails?

2- Do i need to use any third party tool like mail gun or mail chimp?

3- Do i need to use anyother laravel Queue functionality in larave;?

4- anyother suggestion?

04 Aug
1 month ago

engrlaravel started a new conversation Different Routes For Different Roles

Is it possible in laravel to use different route path for different roles?

For example:

role= candidate using this path
    Route::get('dashboard', '[email protected]');

role=admin can use this path
    Route::get('dashboard', '[email protected]');

in routes/web.php file

01 Aug
1 month ago

engrlaravel left a reply on Roles & Permissions In Laravel Application

@Is there any example which showing how to implement laravel-permission? I am worried about, how to make flow or user front end to use/utilize this package

engrlaravel started a new conversation Roles & Permissions In Laravel Application

I am developing complex project in laravel. There should be many companies and many users with different roles.

What is the best way to implement roles & permission?

Do i need to implement custom roles and permission?

Do i need to use any package? which package is very good which can provide all features and without any bugs?

I need your suggestions based on your experience.

engrlaravel left a reply on Get Organization Chart , Parent/Child Relation In Laravel

I want to display it on single query. Something like

Production(Division)

   -IT(Department)

      --Networking(Section)

   -HR(Department)

engrlaravel started a new conversation Get Organization Chart , Parent/Child Relation In Laravel

I have below tables

Divisions(id,title)

Departments(id, division_id,title)

Sections(id,department_id,title)

I want to display it in a tree view. Example: Division->inside it all its departments-> inside each all its sections.

How i can get this whole result in laravel eloquent?

engrlaravel left a reply on Get Parent Of Parent In Laravel Eloquent

That was really easy:). I would have tried!

engrlaravel started a new conversation Get Parent Of Parent In Laravel Eloquent

I have below tables

organizations(id,title) divisions(id,organization_id,title) departments(id, organization_id,division_id,title)

when i display list of departments, i can access division by "belongsTo". How to get Organization title for this department?

Is there any laravel eloquent method?

28 Jul
1 month ago

engrlaravel started a new conversation Forcefully Logout And Keep Website Lock For Sometime

I want admin to create stock report, for that i want him to lock system for all other users except admin. Once he export the report then they can login.

How this can be achieved in laravel?

24 Jul
1 month ago

engrlaravel left a reply on Dynamically Create Subdomain

@mthomas @fraserk : How it can be done dynamically? On successfully signup, you will be redirected to your own sub-domain. is it possible with above approaches?

engrlaravel left a reply on How To Manage Multiple Application Inside One

I checked your code. it do not have multi-app structure. can you explain how you did it?

engrlaravel left a reply on How To Manage Multiple Application Inside One

If you are doing it in LARAVEL, how you will structure it? what will be the application structure for that?

engrlaravel started a new conversation Dynamically Create Subdomain

I have SAAS software. When companies register on my website, i want to give them sub-domain at the same time. Example abc company registered now, the system will automatically redirect him to http://abc.example.com where can can be able to view all my services/features.

Is it possible in laravel? how i can do it?

engrlaravel left a reply on How To Manage Multiple Application Inside One

This is not a good solution. If you manager more than 10 separate module(a complete website), then ask user to select which website/module he is subscribing for.

They way you are doing can not manage such cases

18 Jul
2 months ago

engrlaravel started a new conversation How To Manage Multiple Application Inside One

I need to know how to create an application HUB which have 6 more applications inside? How to manage /Structure it in laravel? Is it possible to do in laravel or which framwork/technology is better?

Example: ZOHO, has other applications like finance,crm etc inside zoho and it share users/organizations profile with in each application.

I want to share most of features to other apps like users/auth etc. Also i will allow some application for some users and restrict others.

I need best idea how to do it so that later i can manage same users at one location for all apps.

Thanks

10 Jul
2 months ago

engrlaravel left a reply on RFID In Laravel

I am developing stock management in a warehouse. I will place RFID on door i think.

engrlaravel left a reply on Media Picker Input Type Control Do Not Save Images In Database

I found this solution, You need to double click on any image, it will be added to above tray. you can delete or sort images there.

04 Jul
2 months ago

engrlaravel left a reply on RFID In Laravel

Ok, I agree with you. I will use SDk & Products of brand like ZEBRA. My Question is what will i need to do at my end in php/laravel & mysql?

02 Jul
2 months ago

engrlaravel started a new conversation Media Picker Input Type Control Do Not Save Images In Database

I am using VOYAGER for laravel. I want to use media picker for images upload.Media Picker input type control do not save images in database.

I want to save all the uploaded images in database also. How i can do it?

engrlaravel started a new conversation RFID In Laravel

Hi, I am working on laravel project. I need to implement RFID in laravel. we need RFID printer and RFID tag & RFID reader in laravel.

Is it possible in laravel? any package in laravel for this?

15 May
4 months ago

engrlaravel left a reply on Data Not Saving In Database Table In Real

@DEVFREY - You mean, if any of the field is missing in $fillable, it will not save?

engrlaravel started a new conversation Data Not Saving In Database Table In Real

I use create method for mass assignment, the result also printed and showing, but when i check table in database, not data inserted. here is my code

            protected $fillable = [
    'first_name', 'last_name', 'role_id', 'email', 'username', 'mobile_country_code', 'mobile', 'password', 
           'status', 'gender','telephone'
       ];

           $users = User::create([
                'first_name'     => $row[1],
                'middle_name'    => $row[2],
                'last_name' => $row[3],
                'email' => $row[4],
                'role_id' => 6,//$row[5],
                'telephone' => $row[6],
                'mobile' => $row[7],

            ]);

            var_dump($users);// this shows result.

Now when i check database users table, not user insterted