TKay

Member Since 3 Years Ago

Dhaka

Senior Software Engineer at Polytec GmbH, Waldbronn, Germany

Experience Points 1,230
Experience Level 1

3,770 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 3
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.

16 Feb
5 months ago

TKay left a reply on Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

I have added A record to my zone. Should I have to add AAAA, CNAME, MX and ohter records too?

TKay left a reply on Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

@TALINON - I don't have any administrator to do that. I have to do it by myself I guess. What should I do?

TKay left a reply on Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

@TALINON - How could I create a DNS alias? where should I look at?

TKay left a reply on Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

@TALINON - trying to host my application to a remote VPS machine ubuntu 16.04 LTS. For production environment: yes.

TKay left a reply on Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

@TALINON - Now it's pinging like below but on browser no response.

ping marketplex.asdtechltd.com PING marketplex.asdtechltd.com (168.235.81.65) 56(84) bytes of data. 64 bytes from marketplex.asdtechltd.com (168.235.81.65): icmp_seq=1 ttl=64 time=0.042 ms

TKay left a reply on Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

@TALINON - Now its pining like below. Is this expected? ping marketplex.asdtechltd.com PING marketplex.asdtechltd.com (127.0.0.1) 56(84) bytes of data. 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=1 ttl=64 time=0.029 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=2 ttl=64 time=0.023 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=3 ttl=64 time=0.035 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=4 ttl=64 time=0.028 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=5 ttl=64 time=0.030 ms 64 bytes from localhost.localdomain (127.0.0.1): icmp_seq=6 ttl=64 time=0.038 ms

TKay left a reply on Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

ping marketplex.asdtechltd.com ping: unknown host marketplex.asdtechltd.com

TKay started a new conversation Host A Laravel 5 Application To A Sub-domain Of Ubuntu 16.04 LTS Server

Hi,

I am expecting to host my laravel 5 aplication to a sub-domain named marketplex.asdtechltd.com. I have configured a *.conf file for my sub-domain named marketplex.asdtechltd.com.conf stated below. But it's not working after a2ensite and service restart. Also changed the /etc/hosts. Would someone help me out to fix my problem? <VirtualHost *:80> # The ServerName directive sets the request scheme, hostname and port that # the server uses to identify itself. This is used when creating # redirection URLs. In the context of virtual hosts, the ServerName # specifies what hostname must appear in the request's Host: header to # match this virtual host. For the default virtual host (this file) this # value is not decisive as it is used as a last resort host regardless. # However, you must set it for any further virtual host explicitly.

    ServerName marketplex.asdtechltd.com
    ServerAlias marketplex
    ServerAdmin [email protected]
    DocumentRoot /var/www/html/marketplex/public/

    <Directory /var/www/html/marketplex/public/>
    Options Indexes FollowSymLinks
    AllowOverride all
    Require all granted
    </Directory>

    # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
    # error, crit, alert, emerg.
    # It is also possible to configure the loglevel for particular
    # modules, e.g.
    #LogLevel info ssl:warn

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # For most configuration files from conf-available/, which are
    # enabled or disabled at a global level, it is possible to
    # include a line for only one particular virtual host. For example the
    # following line enables the CGI configuration for this host only
    # after it has been globally disabled with "a2disconf".
    #Include conf-available/serve-cgi-bin.conf

22 Sep
9 months ago

TKay left a reply on Ubuntu Error Message Extension Missing

In may case i faced ...

In Pusher.php line 221: There is missing dependant extensions - please ensure both      cURL and JSON modules are installed

I have figured out I changed system php interpreter version, So...

Solved by running:

> sudo apt-get install php-curl php-json
04 Jan
1 year ago

TKay started a new conversation Validation Does Not Show/ Render Errors When Redirect()->back() In Laravel 5.4

Hi,

I am providing you the minimal changes. I followed the documentation Laravel 5.4. What did I miss to get validation error message? I debugged error messages generated and post is sent. But no rendering when redirected to previous from submission page.

Routing: api.php

Route::resource('comments', 'CommentController');

View: form1.blade.php

@if (isset($errors) && $errors->any())

@endif

Controller: CommentController.php

/**
 * Show the form for creating a new resource.
 *
 * @return \Illuminate\Http\Response
 */
public function create()
{
    //
    return view('form1');
}

/**
 * Store a newly created resource in storage.
 *
 * @param  \Illuminate\Http\Request  $request
 * @return \Illuminate\Http\Response
 */
public function store(Request $request)
{
    //
    // dd($request->all());
    $v = Validator::make($request->all(), [
        'comment' => 'required|max:20',
    ]);
    if($v->fails())
    {
        return redirect()->back()->withErrors($v)->withInput();
    }

// also tried for automatic redirection
// Validator::make($request->all(), [
    //    'comment' => 'required|max:20',
    // ])->validate() ;
}

composer.json

"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.4.*",
    "laravel/tinker": "~1.0"
},

Please help.

15 Aug
1 year ago

TKay left a reply on Sending Broadcast Event To Pusher Server Using Console Command

I have set in .env file:

QUEUE_DRIVER=database

but when i set:

QUEUE_DRIVER=sync

it sent the message. Problem solved. But not convinced yet why it did not, but now sends the message. If someone can answer I will appreciate that.

09 Aug
1 year ago

TKay left a reply on Pusher Broadcasts (events) Stopped Working, But They Worked 10 Hours Ago.

Me with same problem... no one replied. I think this is something important.

21 Jul
1 year ago

TKay started a new conversation Sending Broadcast Event To Pusher Server Using Console Command

Hi Everyone,

I am trying to do something to run tests on sending laravel events using custom console commands.

Artisan::command('event:send', function () {
        event(new \MarketPlex\Events\ClientAction([ 'id' => 4, 'name' => 'MyEvent' ]));
        $this->comment(Inspiring::quote());
})->describe('throws an event');

My event,

class ClientAction implements ShouldBroadcast

{ use Dispatchable, InteractsWithSockets, SerializesModels;

/**
 * The name of the queue on which to place the event.
 *
 * @var string
 */
public $broadcastQueue = 'client-action';

/**
 * Information about the request created by user action (Must be public, otherwise laravel can't serialize).
 *
 * @var string
 */
public $request;

/**
 * Create a new event instance.
 *
 * @return void
 */
    public function __construct(array $request)
    {
        //
        $this->request = $request;
}
15 Jul
2 years ago

TKay started a new conversation Minimum Required Steps To Send Pusher An API MESSAGE

Would some please let me know the minimum required steps to send pusher server an API MESSAGE from an application server?

> nvm use 8
npm Now using node v8.1.3 (npm v5.2.0)
24 Jan
2 years ago

TKay left a reply on NotFoundHttpException In RouteCollection.php Line 161

run .. to project root

php artisan migrate

then try again.

10 Jan
2 years ago

TKay left a reply on Passing Selected Plan To /register Page Via Url Parameters

Why don't you just show the plans in landing page? Is there any specific concerns that we have to worry about?

TKay left a reply on NotFoundHttpException In RouteCollection.php Line 161

run .. to project root

composer dump-autoload

then try again

TKay left a reply on Seeding Directories Into App Storage Path

Solved by myself...

We have to use File alias in full path ...

use Illuminate\Support\Facades\File;

TKay started a new conversation Seeding Directories Into App Storage Path

Hi,

I have storage/app in my project.

<?php

use Illuminate\Database\Seeder;

use App\File;

class MediaTableSeeder extends Seeder
{
    /**
        * Run the database seeds.
        *
        * @return void
        */
    public function run()
        {
            echo (File::exists(storage_path('app')) ? 'true' : 'false');
    }
}

above shows nothing if i run seeding :

php artisan db:seed --class=MediaTableSeeder

What did i miss? Or have to concern something?

TKay left a reply on Moving Image Files In Seed: Permissions Issues

Hi,

I have storage/app in my project.

<?php

use Illuminate\Database\Seeder;

use App\File;

class MediaTableSeeder extends Seeder
{
    /**
        * Run the database seeds.
        *
        * @return void
        */
     public function run()
        {
            echo (File::exists(storage_path('app')) ? 'true' : 'false');
    }
}

above shows nothing if i run seeding :

php artisan db:seed --class=MediaTableSeeder

What did i miss? Or have to concern something?

01 Jan
2 years ago

TKay left a reply on Uploading File From Laravel Application Using POST Method Causing Internal Server Error

I have searched the forum but I found nothing related getting HTTP 500 code replied for a file upload. It should be as simple as it is to do in laravel.

TKay left a reply on Uploading File From Laravel Application Using POST Method Causing Internal Server Error

Sorry I have changed the route it was a mistake during submission in my post. Corrected like below:

Route::post('/products', function(Illuminate\Http\Request $request) {
    return 'Got it';
} );

Still the same HTTP 500 error code responded. I have tried uploading 70K size photo and 10K size csv file. Is this related to file size?

But I get a black page as reponse. I expected a page should have 'Got it' written on it.

TKay started a new conversation Uploading File From Laravel Application Using POST Method Causing Internal Server Error

I have a simple form ..

<form action="/products" method="POST"
    enctype="multipart/form-data" id="js-upload-form">

             <input type="file" name="csv" id="csv" multiple>
             <button type="submit" class="btn btn-primary btn-flat">Upload Files</button>

    </form>

using routes ...

Route::post('/products/import/csv', function(Illuminate\Http\Request $request) {
    return 'Got it';
} );

Form submitted ... but I get internal server error 500 as response...

am i missing something?

23 Sep
2 years ago

TKay left a reply on Is It Possible In Blade @extend() With Conditions?

Thanks ... it works! Also keeps my view reusable.

TKay left a reply on OrWhereColumnName($value) Is Posssible?

Thank you for pointing the reason behind the magic function 'where'.

TKay started a new conversation Is It Possible In Blade @extend() With Conditions?

Hi everyone I want to choose master based on some conditions. something like this:

@if($user->status == 1)
    @extends('layouts.master1')
@elseif( $user->status == 2 )
    @extends('layouts.master2')
@else
    @extends('layouts.master3')
@endif

Is it possible? I have tried and found all the master mixed up! I need a common view for 3 master templates.

TKay left a reply on OrWhereColumnName($value) Is Posssible?

Hi @SaeedPrez ,

I have tried and it's thrown BadMethodCallException. I thought I was missing something. Like Model::whereColumn() I tried to guess Model::orWhereColumn() method might be there. If you are experienced to do something it will help me to make myself clear the concept.

TKay started a new conversation OrWhereColumnName($value) Is Posssible?

Hi everyone,

I have a table Category which has column 'status'. I want to match 2 types of status:

$categories = Category::whereStatus('APPROVED')->orWhereStatus('REJECTED')->get();

is it posssible?

22 Sep
2 years ago

TKay started a new conversation Model::whereColumn($value) Is Possible?

Hi everyone, I have a eloquent model named Store which has relation ship with another model User. Is it possible to do something like this:

Store::whereUser(Auth::user())

or, Something like:

Store::whereUserId(Auth::user()->id)

which will give me collection of stores?

I found something like:

User::whereToken($token)

TKay left a reply on Select Specific Columns Using Eloquent Orm

Hi everyone, I have a eloquent model named Store which has relation ship with another model User. Is it possible to do something like this: Store::whereUser(Auth::user()) which will give me collection of stores?

28 May
3 years ago

TKay left a reply on [L5] How To Delete A File Using Filesystem

Storage is a Facade and FileSystem used be its interface .... we can't see methods called from Storage under its API docs.

I have tried ... Storage::delete($path . $filename_old);

But it does not remove the file. No errors in logs. What am I missing?

29 Apr
3 years ago

TKay left a reply on Laravel Timstamp Set From Carbon::parse()

SOLVED!

My input format was "Tue May 31 2016 00:00:00 GMT+0900 (Korea Standard Time)" which I was mistaken.

Carbon error showed "Trailing Data" - because the string trailing " (Korea Standard Time)" is not a data format to parse. So parsing was failed. I have used PHP preg_replace() to remove the trailing Time zone elaboration.

    $input_text_expired_at = preg_replace("/\s(\(\w.+)/", "", $inputs['expired_at']);

Mr. @Snapey ... Thank you. You are right. For above format I have used

        'expired_at' => Carbon::createFromFormat('D M d Y g:i:s P', $inputs['expired_at'])

Now my input date format is saving

22 Apr
3 years ago

TKay started a new conversation Laravel 5 PHP Error Safe_mode Is No Longer Available

Please see the following post in stackoverflow ... my question is same... but i could not find my answer there or anywhere

http://stackoverflow.com/questions/13959918/laravel-shared-hosting-directive-safe-mode-is-deprecated-in-php-5-3-and-grea

02 Apr
3 years ago

TKay left a reply on How To Handle Laravel 5 Exceptions

Hi,

I'm getting PDOException which needs to be handled by Exception. In app/Exceptions/Handler.php I wrote inside render()

    if ($e instanceof PDOException) {
                return response()->view('errors.404', [], 404);
    }

But still get the exception extracting whole detail "Whoops, looks like something went wrong."

Is there anything i need to configure to use this exception handler?

29 Mar
3 years ago

TKay left a reply on Laravel Timstamp Set From Carbon::parse()

I have added in my model ...

protected $dates = ['created_at', 'updated_at', 'expired_at'];

I am inserting into database from controller like this ...

$announcement = Announcement::create([ 'title' => $inputs['title'], 'source_url' => $inputs['source_url'], 'has_source_url' => $request->input('has_source_url') == "checked" ? 1 : 0, 'expired_at' => Carbon::createFromFormat('M d, Y', $inputs['expired_at'])->toDateTimeString() ]);

Input field date format is "March 16, 2016"

db connection: mysql

migration script is :

Schema::create('announcements', function (Blueprint $table) { $table->increments('id'); $table->bigInteger('user_id'); $table->string('title')->default('No announcement for today ...')->comment('The title of announcement wchi will show up'); $table->text('source_url')->nullable()->comment('The url where the page will navigate when title clicked'); $table->date('expired_at')->default(Carbon::now()->subWeeks(1))->comment('The data and time when the announcement will dissapear from billboard'); $table->boolean('has_source_url')->default(false)->comment('confirms if it has a source url to navigate'); $table->timestamps(); });

still has the problem

28 Mar
3 years ago

TKay started a new conversation Laravel Timstamp Get From Carbon::parse()

Hi Everyone!

I have a db column 'expired_at' which is migrated usin $table->timstamp('expired_at')

My form input of date for is March 26, 2016

I am setting my db column value using

[ ... 'expired_at' => Carbon::parse($inputs['expired_at'])->toDateTimeString(); ... ]

But it inserts timestamp in db 0000-00-00 00:00:00

How can I insert timestamp using Carbon::parse() ?

08 Feb
3 years ago

TKay left a reply on Laravel Validation And Bootstrap Modal

Hello @rakeshsonea ,

How can I show validation error in bootstrap modal form. In my case the modal dismisses. Without AJAX isn't that possible? I am using laravel 5.2 where :

$this->validate($request, $rules, $messages) ;

is used for validation it shows me validation errors but modal dismisses. my submit button looks like:

I want to view modal form when validation error happens.

Currently I have tried doing like below in my view where the modal form exists:

<script type="text/javascript">
    $('#myform').modal({ 'show' : {{ count($errors) > 0 ? true : false }}  });
    </script>

It works fine but validation errors always showing even if input valid data. lets say just checking 'required' validation. form is not submitting.

Please help me find out what to do.

06 Feb
3 years ago

TKay started a new conversation Guideline To Choose Controller Method Name

I have used a method name to my ProductController.php

    public function new()
    {
        //
        return view('add-product');
    }

which gives me this: FatalErrorException in ProductController.php line 49: syntax error, unexpected 'new' (T_NEW), expecting identifier (T_STRING)

I need help or a look up link if there is any guideline to choose a method name.

30 Jan
3 years ago

TKay left a reply on Laravel View Caching: Stops Revalidating Views

@cristian9509 Thanks for your reply. I have already followed your steps. Here are my related configurations:

config/app.php: .... 'default' => env('CACHE_DRIVER', 'file'),
....

config/filesystems.php: .....

'default' => 'local',

.....

'disks' => [

    'local' => [
        'driver' => 'local',
        'root'   => storage_path('app'),
    ],

.....

config/session.php:

....

'driver' => env('SESSION_DRIVER', 'file'), 'lifetime' => 120, 'expire_on_close' => false, 'files' => storage_path('framework/sessions'), ....

config/view.php: ....

'paths' => [
    realpath(base_path('resources/views')),
],

'compiled' => realpath(storage_path('framework/views')),

I think I am missing something to change somewhere in configurations. If you help me to pin point where to look at it wil help me understand the reason.

I have just created views and laravel 5.2 authentication traits in my project using: php artisan make:auth

I solved once such problem by removing storage cache files before. But now its getting all over again.

Is there any environment switching like development mode or deployment mode? I don't need view caching when I'm developing - I need that when I will deploy it to my live server.

If you need any more info let me know.

TKay started a new conversation Laravel View Caching: Stops Revalidating Views

I need to stop view caching in development environment. I have tried :

php artisan view:clear php artisan clear php artisan route:clear php artisan cache:clear

I have .env file: APP_ENV=local APP_DEBUG=true APP_KEY=VQRHPrhekSe07Q4I04P7NRP5Ex1WbMNG

DB_HOST=localhost DB_DATABASE=abcd DB_USERNAME=root DB_PASSWORD=secret

CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync

MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null

What am i missing?

I can't see my new changes in views when I launch local server using:

php artisan serve

Please give me some lights! Thanks in advance.