sujancse

Member Since 3 Years Ago

Dhaka, Bangladesh

Software Engineer at Pathao Ltd.

Experience Points 29,800
Experience Level 6

200 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 129
Lessons
Completed
Best Reply Awards 24
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

15 May
1 week ago

sujancse left a reply on DataTables Error

I just tried with Laravel Framework 5.8.17. Please delete your vendor folder run composer install again @p

sujancse left a reply on Update Image Show White Square

Could you please show the dump of Auth::user()?

sujancse left a reply on User Data Isn't Showing Form Db And Not Giving Any Error

loadUsers(){
     axios.get("api/user")
    .then(({ data }) => (this.users = data.data))
    .catch(errors => console.log(errors)) // You are missing catch that is why no error is showing
}

sujancse left a reply on Update Image Show White Square

What is images? Is it a database field or relation in User model @bastos?

sujancse left a reply on DataTables Error

composer require yajra/laravel-datatables-oracle:"~9.0"

https://packagist.org/packages/yajra/laravel-datatables-oracle

Hope this will install satisfiable version

30 Aug
8 months ago

sujancse left a reply on Must Be An Instance Of Illuminate\Http\Request, Instance Of StdClass Given

var formData = new FormData(); is not of type Illuminate\Http\Request; that is why you are getting the error.

Why not try

public function authenticate()
{
    $request = \Input::all();
}

sujancse left a reply on My Search Query Is Not Displaying Posts Results 100%.

You wrote raw query $posts = DB::table('posts')->where('title', 'LIKE', '%' . $query . '%')->paginate(10); but trying to access Eloquent relation.

If you have a model Post with two relations photo and user then try

$posts = Post::with('user','photo')->where('title', 'LIKE', '%' . $query . '%')->paginate(10);
04 Jul
10 months ago

sujancse left a reply on Change View Folder Organization Not Got: "View [overview] Not Found."

Check view path in your Controller. Make sure you are pointing to the right directory.

return view('path/to/folder/filename');
01 Jul
10 months ago

sujancse left a reply on Need To Print The Json Data Using Foreach Loop In My View Page

Try this one

<pre>
    {!! json_encode($your_data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) !!}
</pre>
25 Jun
10 months ago

sujancse left a reply on Trying To Get Property Of Non-object

What @Sergiu17 suggest should definitely work. What error messages are you getting @irankhosravi?

24 Jun
10 months ago

sujancse left a reply on Class App\Http\Controllers\blogController Does Not Exist

Check your route maybe you used blogController instead of BlogController

01 Jun
11 months ago

sujancse left a reply on Laravel Model Generate

@gayann you should first search through google then post something in the blog. Have a look at https://laravel.com/docs/5.6/eloquent-relationships

sujancse left a reply on Draggable And Resizable Images Onto Background And Save Into 1 Image

@Robinvm this has nothing to do with laravel. There are lots of jquery plugins out there like https://creativesdk.github.io/web-image-editor-drag-and-drop/

sujancse left a reply on How To Append Row Id To Emp Id.

Need to show your form and controller logic.

30 May
11 months ago

sujancse left a reply on How Do I Search Records Within The Eager Loaded Data?

@yansusanto you were suggested to use LIKE operator for first_name and last_name as they are string. You are not getting any match that is why you are getting the error. In order to ignore this use

isset($post->user->fullname) ? $post->user->fullname : '';

In your blade and close the issue.

For new question please open a new discussion.

sujancse left a reply on How Do I Search Records Within The Eager Loaded Data?

@yansusanto then go with both first_name and last_name

$search_keyword = $request->input('search_keyword');

$posts = Blog::with(['user' => function($query) use ($search_keyword) {
    $query->where('first_name', 'LIKE', '%', .$search_keyword. '%')->orWhere('last_name', 'LIKE', '%', .$search_keyword. '%');
}])
    ->where('title', 'LIKE', '%' . $search_keyword . '%')
    ->latest()
    ->paginate(10);
29 May
11 months ago

sujancse left a reply on How Do I Search Records Within The Eager Loaded Data?

@yansusanto are clear about, what are you looking for? If you are clear then your answer is already given by @Cronix. If your search field name is search_keyword then

$search_keyword = $request->input('search_keyword');

$posts = Blog::with(['user' => function($query) use ($search_keyword) {
    $query->where('name', 'LIKE', '%', .$search_keyword. '%');
}])
    ->where('title', 'LIKE', '%' . $search_keyword . '%')
    ->latest()
    ->paginate(10);

This should solve your problem, just make sure you are getting the search keyword using dd($search_keyword);

27 May
11 months ago

sujancse left a reply on How To Properly Remove Package?

BTW @xenothan, you can completely remove a package by running

composer remove vendor/package-name

composer update

If laravel version < 5.5 then you have to delete the ServiceProvider for the package from config/app.php providers array.

sujancse left a reply on Jquery .text Vs .html

What @jlrdw said is completely right. BTW what are you trying to say @behnampmdg3 ?

$("#page-text").text($("#page-text-textarea").val()); it doesn't make any sense as you don't have any page-text id. Do @behnampmdg3 want to change the label of the textarea from input?

sujancse left a reply on Username For Laravel 5 Instead Of Email Not Working.

@cyrusolu could you please show us your login method logic?

26 May
11 months ago

sujancse left a reply on Update Controller With Multiple Parameters

LaravelCollectiveHtml works on objects. It may be eloquent or normal object. If you can merge this two objects and pass it as a single one, then it should work.

public function edit(Department $department, Course $course)
{
    $model = $course->merge($department->toArray());
    return view('admin.department.course.edit', compact('model'));
}
{!! Form::model($model, ['method' => 'PATCH', 'action'=>['[email protected]', $model->department_id, $model->course_id]]) !!}

    <div class="form-group">
        {!! Form::label('code', 'Code') !!}
        {!! Form::text('code', null, ['class'=>'form-control']) !!}
     </div>

     <div class="form-group">
        {!! Form::label('name', 'Name') !!}
        {!! Form::text('name', null, ['class'=>'form-control']) !!}
     </div>    

    {!! Form::submit('Update', ['class'=>'btn btn-primary']) !!}
{!! Form::close() !!}

sujancse left a reply on Error When Trying To Join Two Tables In Laravel 5.2, For A Search Query

You have to select cities.id as well. like ...

$listing = Listing::join('cities', 'listings.city_id', '=', 'cities.id')
                         ->select('cities.id','listings.city_id', 'cities.name')
                         ->where ( 'name', 'LIKE', '%' . $q . '%' )
                         ->paginate(8);
17 May
1 year ago

sujancse left a reply on Question About Many To Many In ORM

Obviously you have to use a pivot table named activity_user. But you can override the pivot then you have to define it in the relationship in model.

Go through the link https://laravel.com/docs/5.6/eloquent-relationships#many-to-many

sujancse left a reply on Question About Many To Many In ORM

public function acts() {
    return $this -> hasMany(`App\Activity`, `act_id`);
}

should be

public function acts() {
    return $this->belongsToMany(`App\Activity`, `act_id`);
}

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

21 Feb
1 year ago

sujancse left a reply on ERROR: Creating Default Object From Empty Value

I think you are not getting any $pin in $pin = ActivationPin::wherePin($request->pin)->first();

Try dumping $pin

dd($pin);
20 Feb
1 year ago

sujancse left a reply on Installing Homestead And Having Problems

You first need to install composer in your system https://getcomposer.org/download/

sujancse left a reply on How To Solve This Data Update Error In Laravel

Hey @Kistlak I think you don't have a named route AdminPanel that is why you are getting the error. But your data should be updated.

The problem is in this line return redirects('AdminPanel');.

sujancse left a reply on Blada Dont Show Http

use {!! !!} instead of {{ }}

10 Feb
1 year ago

sujancse left a reply on AppServiceProvider.php

This is all about view composer. At first you have to learn the basics https://laravel.com/docs/5.6/views#view-composers

sujancse left a reply on Url Generator Parameter Missing

This is because of your / in the route. Change Route::resource('admin/ads/', 'AdsController') to Route::resource('admin/ads', 'AdsController')

Then you will get admin/ads/{ads}

07 Feb
1 year ago

sujancse left a reply on Casting JSON To Array; Undefined Index.

If am I not wrong casts is for mutators https://laravel.com/docs/5.6/eloquent-mutators#array-and-json-casting

You can just decode $account->location like

$location = json_decode($account->location);
$city = $location->city;
$zip = $location->zip;

I think you got the idea.

sujancse left a reply on Casting JSON To Array; Undefined Index.

Need to see your collection dump

sujancse left a reply on Is There A Way To Get A List Of Rows With A Unique Column

Post::select('channel')->distinct()->addSelect('column1','column2')->get();

https://laravel.com/docs/5.6/queries#selects

sujancse left a reply on OrderBy Created At On A Relationship Table

$company = Company::with(['job' => function($query){
    $query->orderBy('created_at');
}])->get();

sujancse left a reply on Is There A Way To Get A List Of Rows With A Unique Column

Post::select('channel')->distinct()->get();

sujancse left a reply on Please Help Me Have This Problem With Larael 5.5 Te

It's a dockerized project. So run docker-compose up -d in your project root you are good to go Try 127.0.0.1:8080 in your browser.

sujancse left a reply on Please Help Me Have This Problem With Larael 5.5 Te

Just copy everything from .env.example to .env and run php artisan key:generate to generate an encryption key

Make necessary changes for database configuration

sujancse left a reply on Please Help Me Have This Problem With Larael 5.5 Te

Did you make .env file and run php artisan key:generate?

sujancse left a reply on Named Route Is Being Overwritten

Just run php artisan route:list you will get your answer

01 Feb
1 year ago

sujancse left a reply on Laravel 4.2 Warning: Unknown: Failed To Open Stream: No Such File Or Directory In Unknown On Line 0

Change debug=false to debug=true in your .env file or You need to edit the config/app.php file and change the debug = false to debug = true.

sujancse left a reply on How To Return Redirect With {username}?

return redirect()
    ->route('user.profile.show', ['username' => $user->username]);

sujancse left a reply on Route To View Directly

You can do so like

Route::get('/your-route', function() {
    return view('directory.file-name');
});