habib997

habib997

Member Since 1 Year 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
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
450 XP
Nov
18
2 days ago
Activity icon

Replied to Deployment Of Laravel Wildcard Subdomain App On Shared Hosting Server Causing Error

@sinnbeck yes it is loading the image but when I access anysubdomain.client.net it throws 403 error and sometimes 404. I think It is assuming that another copy of project should be in wildcard subdomain folder but that's not I want. how to do step 2

Activity icon

Replied to Deployment Of Laravel Wildcard Subdomain App On Shared Hosting Server Causing Error

@sinnbeck @snapey I have already created wildcard subdomain and there are already records in zone editor automatically. see the A record in the image link https://imggmi.com/full/2019/11/18/5a8494d690f847a7452732d59a5d5ec8-full.png.html and there is nothing in wildcard subdomain folder. is this right?

Activity icon

Replied to Deployment Of Laravel Wildcard Subdomain App On Shared Hosting Server Causing Error

@sinnbeck my website is at app.client.net and my wildcard subdomain routes are in that app.client.net as I showed above code. It is only one app that running app.client.net routes and wildcard subdomain routes. I hope you may get me point. I will contact my provider and then see what they say

Nov
16
4 days ago
Activity icon

Started a new Conversation Deployment Of Laravel Wildcard Subdomain App On Shared Hosting Server Causing Error

I have searched all the questions related to my questions on StackOverflow but didn't find any solution. I have developed a laravel wildcard subdomain project and is working good on localhost now it is causing problems on wildcard subdomains when I deployed the project on server.here is my project route.php file

<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
*/
Route::group(['domain' => 'app.client.net'], function(){
    Route::get('/', function () {
        if (auth()->check()) {
            return redirect('http://'.session('subdomain').'.client.net/home');
        }       
        return view('welcome');
    })->name('homepage');   
    Route::get('/register', 'Auth\[email protected]')->name('register');
    Route::post('/register', 'Auth\[email protected]');
    Route::get('/login', 'Auth\[email protected]')->name('login');
    Route::post('/login', 'Auth\[email protected]')->name('login');
    Route::get('/setupCompany', '[email protected]')->name('setupCompanyForm');
    Route::post('/setupCompany', '[email protected]')->name('setupCompany');
    Route::get('/register/verify', '[email protected]')->name('registerVerify');

});

Route::group(['domain'=> '{subdomain}.client.net', 'middleware' => 'checkSubdomain'],function () {
    Route::get('/', 'Auth\[email protected]')->name('companyLogin');
    Route::post('/', 'Auth\[email protected]')->name('companyLogin');

    Route::group(['middleware' => 'customAuth'],function(){         
        Route::get('/home', '[email protected]')->name('home');
        Route::post('/logout', 'Auth\[email protected]')->name('logout');
        Route::post('/inviteClient', '[email protected]'); //ajax req
        Route::get('/profile', ['as' => 'profile.edit', 'uses' => '[email protected]']);
        Route::put('profile', ['as' => 'profile.update', 'uses' => '[email protected]']);
        Route::put('profile/password', ['as' => 'profile.password', 'uses' => '[email protected]']);

        Route::get('/getClients', '[email protected]'); //ajax req

    });
});

I have the following routes. app.client.net for user registration and wildcard subdomain *.client.net for logged in users. In my app user registers himself through app.clients.net and logged in and redirect to its wildcard subdomain. It is working properly on localhost but not on live server. I deployed it on a live server by making app.client.net subdomain on a server and deployed project there then wildcard subdomain {subdomain}.client.net is not working. when I go to app.client.net it is working properly but when I go to wildcard subdomain e.g abc.client.net it gives the following error.

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

how to configure this so that static subdomain(app.client.net) and wildcard subdomain({subdomain.client.net}) both can work? Note: I am not creating any subdomain on the server it is just database entry which checks subdomain exists in the database if it does then it uses it as a wildcard subdomain. I am on shared hosting and I do not have httpd.conf file access.

Nov
08
1 week ago
Activity icon

Replied to How To Setup Relationship Between User With His Clients, Team Members And Project In Laravel

@jlrdw i know how to make relations but I am asking which is better to do. Should I make teammember table and relate projects table with teammember table for many-to-many relationship or I have to convert subuser table from one-to-many to many-to-many relationship and store team members and clients in subuser table? A client has many projects created by user(subscriber) but each project can have only one client. And a team member has many projects created by user(subscriber) and a project can have many team members.

Activity icon

Replied to How To Setup Relationship Between User With His Clients, Team Members And Project In Laravel

@douglasakula read the last paragraph of my question you will know what i am asking...

Activity icon

Replied to How To Setup Relationship Between User With His Clients, Team Members And Project In Laravel

right now to store the subscribers' clients and project table has subuser_id foreign key that is one-to-many relationship. now I am implementing team members so I am confusing how to structure it...

Activity icon

Started a new Conversation How To Setup Relationship Between User With His Clients, Team Members And Project In Laravel

I am building a saas project in which user is admin which subscribes the app and he can create projects, create clients and team members through invitation and assign the project to clients and team members. A client has many projects which is one to many relationship. Team member has many projects and project has many team members which is many to many relationship. When clients or team members login they see only projects that are assigned by the user. What I have done so far is.

USER table which contains login credentials of all users whether subsrciber, client or team member.

id | username | email | password | isAppAdmin | email_verified_at

Role table contains Subscriber, Client and Team member roles

id | name

Permission table

Role_Permission table

role_id | permission_id

User_Role table

user_id | role_id

Subuser table which is currently has one to many relationship with User table and currently contains only clients.

subuser_id | user_id | email | username | userType | status

Project table

project_id | user_id | subuser_id | title

How to setup table between user and team members and projects which is many-to-many relationship between teammembers and projects. Should I make teammember table and relate projects table with teammember table for many-to-many relationship or I have to convert subuser table from one-to-many to many-to-many relationship and store team members and clients in subuser table. A client has many projects created by user(subscriber) but each project can have only one client. And a team member has many projects created by user(subscriber) and a project can have many team members.

Sep
27
1 month ago
Activity icon

Replied to Wildcard Subdomain Is Not Working On Live Server

@resin can not we do through .htaccess?

Activity icon

Replied to Wildcard Subdomain Is Not Working On Live Server

@resin I am on shared hosting that's why I can not access httpd.conf file. Is there any way out so I can achieve this?

Activity icon

Replied to Wildcard Subdomain Is Not Working On Live Server

@joveice can you please explain how to configure this. I am on shared hosting and I do not have access to httpd.conf file...

Activity icon

Replied to Wildcard Subdomain Is Not Working On Live Server

@resin yes I changed it and then go to app.example.net in browser and it is echoing 'works'. There is no virtual host file in my hosting server, the above virtual host file is in my windows...

Activity icon

Replied to Wildcard Subdomain Is Not Working On Live Server

@resin this is mine

<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/example/public"
    ServerName app.example.net
    ServerAlias *.example.net
    <Directory "C:/xampp/htdocs/example/public">
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>
Activity icon

Replied to Wildcard Subdomain Is Not Working On Live Server

@resin apache. how to set up the server to handle this. It is working on app.example.net but not on e.g john.example.net however i have made wildcard subdomains routes in web.php like above.

Activity icon

Replied to Wildcard Subdomain Is Not Working On Live Server

@joveice abc.example.net does not exist it is just wildcard subdomain...

Sep
26
1 month ago
Activity icon

Started a new Conversation Wildcard Subdomain Is Not Working On Live Server

I deployed my project on live server by creating subdomain app.example.net on cpanel. And put my project in app.example.net folder. In my project I have two route groups like below

Routes.php

<?php

Route::group(['domain' => 'app.example.net'], function(){
    Route::get('/', function () {
        if (auth()->check()) {
            return redirect('http://'.session('subdomain').'.example.net/home');
        }       
        return view('welcome');
    })->name('homepage');   
    Route::get('/register', 'Auth\[email protected]')->name('register');
    Route::post('/register', 'Auth\[email protected]');
    Route::get('/login', 'Auth\[email protected]')->name('login');
    Route::post('/login', 'Auth\[email protected]')->name('login');
    Route::get('/setupCompany', '[email protected]')->name('setupCompanyForm');
    Route::post('/setupCompany', '[email protected]')->name('setupCompany');
    Route::get('/register/verify', '[email protected]')->name('registerVerify');

});

Route::group(['domain'=> '{subdomain}.example.net', 'middleware' => 'checkSubdomain'],function () {
    Route::get('/', 'Auth\[email protected]')->name('companyLogin');
    Route::post('/', 'Auth\[email protected]')->name('companyLogin');

    Route::group(['middleware' => 'customAuth'],function(){         
        Route::get('/home', '[email protected]')->name('home');
        Route::post('/logout', 'Auth\[email protected]')->name('logout');
        Route::post('/inviteClient', '[email protected]'); //ajax req
        Route::get('/profile', ['as' => 'profile.edit', 'uses' => '[email protected]']);
        Route::put('profile', ['as' => 'profile.update', 'uses' => '[email protected]']);
        Route::put('profile/password', ['as' => 'profile.password', 'uses' => '[email protected]']);

        Route::get('/getClients', '[email protected]'); //ajax req

    });
});

here is my .htaccess file in project's public folder

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>

when I go to app.example.net it works but when I go to wildcard subdomain e.g abc.example.net it gives 404 error

Not Found
The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request

how to resolve this error so that wildcard subdomain also works.

Note: I am not creating any subdomain just store subdomain name entry in db and check whether the subdomain entry exist in db , if yes then go to that wildcard subdomain otherwise not found error.