Aqeel94321

Aqeel94321

Web developer at COMSATS university Islamabad,Lahore Campus

Member Since 1 Year Ago

Lahore

Experience Points
2,160
Total
Experience

2,840 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
2
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
2,160 XP
Dec
24
4 weeks ago
Activity icon

Replied to How To Validate .webp Extension Files

@bobbybouwmann thanks for your reply,

here is my controller:

public function update(Request $request, $pack, $id)
    {
        $this->validate($request,[
            'sticker' => 'mimetypes:image/webp',
        ],[
            'sticker.mimetypes' => 'image file extension should be .webp '
        ]);

        $sticker=Sticker::find($id);

        if ($request->sticker) {

            File::delete($sticker->sticker);
            $resize = Image::make(imagecreatefromwebp($request->sticker));
            $imageName = rand(1, 100000) . '.' . $request->sticker->getClientOriginalExtension();
            $path = public_path('sticker/' . $pack . '/');
            if (!File::isDirectory($path)) {
                File::makeDirectory($path, 0777, true, true);
            }
            $resize->save($path . $imageName);
            $filename = 'sticker/' . $pack . '/' . $imageName;
            $sticker->sticker=$filename;

        }
        $sticker->save();
        return redirect()->route('pack.show', $pack)->with('success', 'Sticker updated successfully');
    }

here is my form:

<form action="{{route('sticker.update',[$pack,$sticker->id])}}" method="post" role="form" enctype="multipart/form-data">
      @csrf
  <div class="card-body">
    <div class="form-group">
         <label for="filename">Images</label>
        <input type="file" name="sticker" class="form-control @error('sticker') is-invalid @enderror " id="sticker">
        @error('sticker')
        <div class="alert alert-danger">{{ $message }}</div>
        @enderror
    </div>
</div>
                                <!-- /.card-body -->
 <div class="card-footer">
    <button type="submit" class="btn btn-primary">Submit</button>
 </div>
</form>
Activity icon

Started a new Conversation How To Validate .webp Extension Files

Hi, I have problem in validating of '.webp' extension file.

$this->validate($request,[
            'sticker' => 'mimetypes:image/webp',
        ],[
            'sticker.mimetypes' => 'image file extension should be .webp '
        ]);

how can i do?

when submit a form request its not validated and do task without validated input.

Oct
22
3 months ago
Activity icon

Replied to Create Database With Username And Password Using DB:statement()?

@sinnbeck here is my code for making database and run migrations dynamically

    $new_db = DB::statement('CREATE DATABASE `aqeel`');
        DB::statement("CREATE USER 'aqeel_root'@'localhost' IDENTIFIED BY 'aqeelroot' ");
        DB::statement("GRANT ALL PRIVILEGES ON * . * TO 'aqeel_root'@'localhost'");

        if ($new_db) {

            $config = Config::get('database.connections.main');

            $config['database'] = env('DB_DATABASE', $dbName);
            $config['username'] = env('DB_USERNAME', 'aqee_lroot');
            $config['password'] = env('DB_PASSWORD', 'aqeelroot');

            Config::set('database.connections.main', $config); 
            Config::set('database.default', 'main'); 
            Artisan::call('migrate');
        }
Activity icon

Replied to Create Database With Username And Password Using DB:statement()?

@sinnbeck all these stuff working fine in localhost. but when i add code to live server it give error:

Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1044 Access denied for user 'nhkhan_root'@'localhost' to database 'adeel' (SQL: CREATE DATABASE adeel)

how can we make database with user and give previligies on hostgator server?

Activity icon

Replied to Create Database With Username And Password Using DB:statement()?

@sinnbeck I am making database with same code that your provide but know i want to make user and its permissions when database created. ?

Activity icon

Replied to Create Database With Username And Password Using DB:statement()?

@sinnbeck how can we make user with permission when we create database dynamically?

Activity icon

Started a new Conversation Create Database With Username And Password Using DB:statement()?

create database programmatically using laravel DB facade or any other solution..

have any idea?

Activity icon

Replied to Access Denied For User

@sinnbeck yes everything fine but i don't know why the issue appear.

Activity icon

Started a new Conversation Access Denied For User

My project work fine for localhost but when i deploy to server and want to login it through that error.

Illuminate\Database\QueryException SQLSTATE[42000] [1044] Access denied for user 'nhkhan_root'@'localhost' to database 'nhkhan_daycare' (SQL: select * from admins where email = aqeelkhadim93@gmail.com limit 1)

have any idea what the issue is?

Oct
03
3 months ago
Activity icon

Started a new Conversation Share Dynamic Parameter To All Views And Middleware?

I want to share some between view and middleware how can we achieve it?

$a=url()->current();
        $name = explode('//' ,$a);
        $subdomain = explode('.' ,$name[1]);
        View::share('subdomain', $subdomain[0]);

this data share all view.

But if i want to share this data with middlewares how i can?

Sep
25
3 months ago
Activity icon

Replied to How To Refactor Database Name Dynamically

@rwashingtonta I'm currently working on multi-tenant web application and in which one of my requirement is if Admin can want to create/edit database name than admin can update database name dynamically

Activity icon

Replied to How To Refactor Database Name Dynamically

@siangboon THANKS for your reply. you answer only for table name refactor but i want to refactor database name only

Activity icon

Started a new Conversation How To Refactor Database Name Dynamically

Hi! Everyone I want to know how to refactor database name dynamically?

For example i have database of name "laravel" but know i change this name to "laravel_demo" can it possible using programming ?

without changing manually i want to make automate this.

Thanks in advance.:)

Sep
18
4 months ago
Activity icon

Started a new Conversation Laravel Spatie Error [ Target Class [role] Does Not Exist. ]

Hi! here is and error how can cofigure?

Illuminate\Contracts\Container\BindingResolutionException
Target class [role] does not exist.
http://aqeel.localhost:8000/admin/dashboard
Sep
16
4 months ago
Activity icon

Replied to How Can I Check How Much Database Connection Dynamically

@ftiersch @tykus how can get connected databases name?

Activity icon

Replied to How Can I Check How Much Database Connection Dynamically

@ftiersch @tykus If i want to know about how much database are connected with one connection?

Activity icon

Replied to How Can I Check How Much Database Connection Dynamically

@ftiersch how can get name of these connection?

Activity icon

Started a new Conversation How Can I Check How Much Database Connection Dynamically

Hi!

How can i check how much database connection are setup dynamically.

in my database config file two connection are setup.


'mysql' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB_HOST', '127.0.0.1'),
            'port' => env('DB_PORT', '3306'),
            'database' => env('DB_DATABASE', 'forge'),
            'username' => env('DB_USERNAME', 'forge'),
            'password' => env('DB_PASSWORD', ''),
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

'tenant' => [
            'driver' => 'mysql',
            'url' => env('DATABASE_URL'),
            'host' => env('DB2_HOST', '127.0.0.1'),
            'port' => env('DB2_PORT', '3306'),
            'database' => '',
            'username' => '',
            'password' => '',
            'unix_socket' => env('DB_SOCKET', ''),
            'charset' => 'utf8mb4',
            'collation' => 'utf8mb4_unicode_ci',
            'prefix' => '',
            'prefix_indexes' => true,
            'strict' => true,
            'engine' => null,
            'options' => extension_loaded('pdo_mysql') ? array_filter([
                PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
            ]) : [],
        ],

Thanks in advance. :)

Sep
13
4 months ago
Activity icon

Started a new Conversation Middleware In Laravel

Hi i want to know how we redirect a middleware to grouped route middleware

For example:

Route::group([
'domain' => '{subdomain}.localhost',
'middleware'=> 'checksubdomainanddatabase'
], function () {

            
        });

in middleware

$domain = Domain::where('domain_name', Route::current()->parameters['subdomain'])->first();
            if ($domain){
               return ;  // groupedroute ??
            }

how can we redirect to Route::group(); can we assign name to Route::group() if yes then how?

Thanks in Advance..

Sep
11
4 months ago
Activity icon

Replied to Multi-tenancy Using Laravel App

@sti3bas Hyn documentation is not properly i read previously.

Thanks BTW. Your reply means to me.

Activity icon

Replied to Multi-tenancy Using Laravel App

@sti3bas Can you have "hyn 5.4" i only required simple project integration??

You say it worked really good but i face much difficulties to integration with this package. Can you send demo for that instead of this boiler plate that you mention above.

Activity icon

Replied to Multi-tenancy Using Laravel App

@sti3bas Thanks for your reply.

Every package have own limitations. Can you suggest best package for multi-tenancy and have demo project for that. i read documention of https://tenancy.dev/docs/hyn/5.4 but i can't understand how it work..

but my requirement is multi-tenancy with multiple databases because every client have confidential data.

Activity icon

Started a new Conversation Multi-tenancy Using Laravel App

Hi! Everyone. I want to make multi-tenant app using laravel but i don't want to use any multi-tenancy laravel package to achieve multi-tenancy.

Can you help me how to achieve multi-tenancy in laravel 6.0 i have achieved some task like( dynamic db created and migrate the migration related to tenant and redirect admin to its domain.) but in which i have some issue related to only admin redirect its domain..

1: if i create new user then it will not rediect to its domain that are admin domain. 2: how Sub-Domain Routing work? can i achieve multi-tenancy using sub-domain routing.

Sep
07
4 months ago
Activity icon

Replied to Multi Tenancy Using Multiple Databases

@hamelraj Thanks for your reply How can we get server name? and i'm little bit confuse of your reply.

Activity icon

Started a new Conversation Database Exist Or Not ?

Hi! How can we check if database is exist or not in Laravel 6.0 ??

your help really appreciated.

Aug
30
4 months ago
Activity icon

Replied to Call Model Function Inside Model

Create private function of secondFunction.

public static function FirstFunction(){

$this->secondFunction(); }

private function secondFunction(){

}
Activity icon

Started a new Conversation Multi Tenancy Using Multiple Databases

I have 3(three) migration: 1: users 2: websites 3: databases

users migration: users have name, email , phone , and passwords

websites migration: websites have websitename , domain , http_status and user_id,

databases migration: databases have dbname , dbuser, dbpassword , dbconnection , website_id

user hasOne website. and websites hasOne database.

how can i achieve multi-tenancy using these schema i want to use middleware for redirect to domain that are associated with this user and only access to database that are associated with this website?

usi

Aug
21
5 months ago
Activity icon

Replied to Domain Mapping Using Laravel

@andresayej How can i achieve multi-tenancy in my app if i make custom algorithm for that task please give suggestion

Activity icon

Replied to Domain Mapping Using Laravel

Thanks buddy. Yes i want multi-tenancy in my laravel web app.. Thank for your reply.

Aug
20
5 months ago
Activity icon

Started a new Conversation Domain Mapping Using Laravel

Hi! Every one, I have an scenario for my website which i want to build.

For example,

I have website which domain is 'abcd.com' and i want all my client use same domain with concatenate client website domain which client select and new domain something like this 'abcd.com/xyz.com' what can i do please give suggestions and if anyone have tutorial please share with me..

Your help really appreciated. Thanks In Advance.