sujancse

Member Since 3 Years Ago

Dhaka, Bangladesh

Software Engineer at Pathao Ltd.

Experience Points 30,760
Experience Level 7

4,240 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 138
Lessons
Completed
Best Reply Awards 24
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.

17 Jun
2 months ago

sujancse left a reply on Assets Not Loading In Localhost

You are one directory up from public directory. Now you have to use

<<script src="{{ asset('public/assets/js/app.min.js') }}"></script>

@venkatiiitb

15 May
3 months ago

sujancse left a reply on DataTables Error

I just tried with Laravel Framework 5.8.17 it worked just fine. Please delete your vendor folder run composer install again @PhoeniX5

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
11 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 https://laravel.com/docs/5.6/eloquent-relationships 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);

Everything will work just fine.

04 Jul
1 year 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
1 year 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>
24 Jun
1 year 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
1 year ago
30 May
1 year 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
1 year ago

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

@yansusanto are you 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
1 year 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
1 year 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

In your $listing you are not getting any results. In order to form the correct query you have to select cities.id as well. As it is making the relationship with listings table. 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');.

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 Asset()

asset() method return the base path which is laravel public directory. Follow the api docs https://laravel.com/api/5.6/Illuminate/Contracts/Routing/UrlGenerator.html#method_asset you will get the clear idea

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/{ad}

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();

https://laravel.com/docs/5.6/eloquent-relationships#eager-loading

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.

Or you can just run php artisan serve

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

31 Jan
1 year ago

sujancse left a reply on Project Loads But No Styling

Checkout the css path in /resources/views/layout.blade.php

sujancse left a reply on Laravel Custom Authentication

Then there should be the logged in user. Make sure you are calling the correct function.