afoysal

afoysal

Member Since 4 Years Ago

Experience Points 12,220
Experience Level 3

2,780 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 17
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.

19 Sep
13 hours ago

afoysal left a reply on HTTP Request Manipulation

@nakov , I am using below code

if($request['password'] = '') {
       $request->except(['password']);
    } 
    $result = User::create($request->all());

But I am getting below error

enter image description here

afoysal started a new conversation HTTP Request Manipulation

How can I remove $request['password'] from $request->all() ?

Thanks

18 Sep
1 day ago

afoysal left a reply on 500 Error

Thanks Your solution is working.

afoysal left a reply on 500 Error

I have cPanel. How can I check Server Log ? Thanks.

afoysal started a new conversation 500 Error

Previously the Laravel application is running well. But after I update the whole code I am getting 500 Internal Server Error.

Do you have any clue why I am getting 500 Internal Server Error ?

enter image description here

afoysal left a reply on Authentication In Another Contorller

Thanks @emadiga for your reply. Your solution is not working. I am trying like below

    $result = User::create($request->all());
            $user = $request->all();
            Auth::login($user);

            if($result){
            return response()->json(['result' => 1]);
        }else {
            return response()->json(['result' => 0]);
        }
17 Sep
2 days ago

afoysal started a new conversation Authentication In Another Contorller

I need to redirect User to dashboard (which is a authenticated page ) after User registration. My Registration code is like below which is in UserController.php

$result = User::create($request->all());

Which code should I write to authenticate the User here ?

afoysal left a reply on FaceBook Login

Thanks @sti3bas . I created Facebook App to get App ID and I have App ID. What to do next ?

afoysal started a new conversation FaceBook Login

I am working in a purchased Laravel script. I need FaceBook login. In Login page I am getting view like below.

enter image description here

If I click on Facebook I am redirected to Facebook and getting view like below

https://i.stack.imgur.com/EEOCU.png

I am new FaceBook login development. How can I develop a FaceBook Login ?

afoysal left a reply on Route Is Not Working

Thank You. Your solution is working. Thanks.

afoysal left a reply on Route Is Not Working

@munazzil , why it is going to header.blade.php ? It should die('hello'). Isn't it ? Thanks.

afoysal started a new conversation Route Is Not Working

My route is like below

Route::get('/create_user', function()
{
    die('hello');
});

I am trying to browse like below

http://127.0.0.1:8000/create_user

I am getting error like below

Call to a member function getName() on null (View: /var/www/html/bs/resources/views/layouts/header.blade.php)

Why I am getting this error ?

afoysal started a new conversation FaceBook Modal Is Not Coming Up In Laravel Home Page

I am trying to use FaceBook Login through a modal in Laravel Home Page. If I click on below button FaceBook Login Modal will come up.

<li>
   <a href="#sign-in-dialog" class="login sign-btn" title="Sign In">Sign In</a>
</li>

My Modal HTML code is like below

<div id="sign-in-dialog" class="zoom-anim-dialog mfp-hide">
   //  more code
</div>

I am using Bootstrap4 like below

<link href="http://127.0.0.1:8000/assets/css/bootstrap4.min.css" rel="stylesheet">

But this is not working.

16 Sep
3 days ago

afoysal started a new conversation Owl Carousel With Laravel Cacheing Issue

I am working in a Laravel Application. Here I am using Owl Carousel. My code for Owl Carousel is like below

$('#reccomended').owlCarousel({
        center: true,
        items: 2,
        loop: true,
        margin: 0,
        responsive: {
            0: {
                items: 1
            },
            600: {
                items: 2
            },
            767: {
                items: 2
            },
            1000: {
                items: 3
            },
            1400: {
                items: 4
            }
        }
    });

I am supplying data to Owl Carousel from database. I deleted all data from Database but Owl carousel still displaying data.

What is the solution ?

11 Sep
1 week ago

afoysal left a reply on Use Flash Message In Blade Template

How can I use your solution with return view() ?

10 Sep
1 week ago

afoysal started a new conversation Use Flash Message In Blade Template

I have controller and function like below

class UserController extends Controller
    {

        public function index(){
            $title = trans('app.users');
            $users = User::orderBy('first_name', 'asc')->paginate(20);
             $users_count = User::count();
            return view('admin.users', compact('title', 'users', 'users_count'));
     }
}

I have a blade template named flash_msg.blade.php which has below content.

@if(session('success'))
        <div class="alert alert-success">
            {!! session('success') !!}
        </div>
@endif

@if(session('error'))
        <div class="alert alert-danger">
            {!! session('error') !!}
    </div>

@endif

I included below code in my blade template.

@include('admin.flash_msg')

How can I use this ? Which code should I write in controller to get the result of Flash Message ?

Thanks

05 Sep
2 weeks ago

afoysal started a new conversation Class Method Is Not Working

`<?php

namespace App\Http\Controllers\TrainingSessions;

use Illuminate\Http\Request; use App\Http\Controllers\Controller; use App\Repositories\ResourceRepository; use App\Models\TrainingSchedules; use Auth,Redirect,Log,Alert;

class CreateController extends Controller { protected $request,$schedules,$trainer_id;

public function __construct(Request $request,TrainingSchedules $schedules) 
{
    $this->middleware('auth');
    $this->request = $request;
    $this->schedules = new ResourceRepository($schedules); 
}

public function index() 
{ 
    $previous_schedule = TrainingSchedules::where('trainer_id', '=', $this->request->trainer)
    ->where('date_start', '=', $this->request->date)
    ->where('time_start', '=', $this->request->start)
    ->where('time_end', '=', $this->request->end)
    ->count();        

    
    if($previous_schedule == 0) {
        $params = [
            'trainer_id' => $this->request->trainer,
            'level' => $this->request->level,
            'date_start' => $this->request->date,
            'time_start' => $this->request->start,
            'time_end' => $this->request->end,
            'training_status' => 'pending',
            'status' => 1
        ];

        $save = $this->store($params);
        return $save ? $this->success() : $this->error();
    }
    else {            
        $this->previously_exists();   // Why this is not working ?
    }
} 

public function store($params)
{
    return $this->schedules->create($params);
}

public function success()
{
    Alert::success('Training Schedule was successfully added', 'Success'); 
    return Redirect::route('training.sessions');
}

public function error()
{
    Alert::error('Something went wrong !', 'Failed'); 
    return Redirect::route('training.sessions');
}

public function previously_exists()
{
    Alert::error('Training Schedule is previously exists !', 'Failed'); 
    return Redirect::route('training.sessions');
}

}`

Why this is not working $this->previously_exists(); ?

03 Sep
2 weeks ago

afoysal left a reply on Wokring Using Git

Why git checkout -b newBranchName used ?

afoysal left a reply on Wokring Using Git

I have to push in a new branch.

afoysal started a new conversation Wokring Using Git

I cloned a project from remote repo. I cloned from master. Which Git commands should I use after or before development ?

01 Sep
2 weeks ago

afoysal started a new conversation How To Use GroupBy()

My query is like below

 public function comment($qid) {
    $question_data = DB::table('pre_training_questionaires')
    ->join('sports as sports_primary','pre_training_questionaires.primary_sport', '=', 'sports_primary.id')
    ->leftJoin('sports as sports_secondary','pre_training_questionaires.secondary_sport', '=', 'sports_secondary.id')
    ->leftJoin('sports as sports_others','pre_training_questionaires.additional_sport', '=', 'sports_others.id')
    ->leftJoin('sport_position as position_primary','pre_training_questionaires.primary_sport_position', '=', 'position_primary.id')
    ->leftJoin('sport_position as position_secondary','pre_training_questionaires.secondary_sport_position', '=', 'position_secondary.id')
    ->leftJoin('invitations','pre_training_questionaires.user_id', '=', 'invitations.athlete_id')
    ->leftJoin('training_schedules','invitations.training_schedules_id', '=', 'training_schedules.id')
    ->where('pre_training_questionaires.id',  $qid)
    ->select('pre_training_questionaires.*','sports_primary.sport_name as primarySports','sports_secondary.sport_name as secondarySports','sports_others.sport_name as othersSports','position_primary.position_name as primaryPosition','position_secondary.position_name as secondaryPosition','training_schedules.trainer_id')
    ->groupBy('pre_training_questionaires.id')
    ->get();

    dd($question_data);
}

I am getting error like below

enter image description here

How can I solve this ?

31 Aug
2 weeks ago

afoysal left a reply on How To Make Text Bold In Laravel Blade Template

You are right "the style for strong has been reset by the css tools that you are using". Thanks.

afoysal left a reply on How To Make Text Bold In Laravel Blade Template

Your solution is not working.

afoysal started a new conversation How To Make Text Bold In Laravel Blade Template

I am trying to make text bold in blade template like below

<strong>{!! $accepted_invitation->first_name !!}</strong>

But it is not working.

30 Aug
2 weeks ago

afoysal started a new conversation Trying To Get Property 'headers' Of Non-object

Why I am getting this error ?

enter image description here

23 Aug
3 weeks ago

afoysal left a reply on Empty Route Files

Thanks @nakov . Here is my RouteServiceProvider

`<?php

namespace App\Providers;

use Illuminate\Support\Facades\Route; use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;

class RouteServiceProvider extends ServiceProvider { /** * This namespace is applied to your controller routes. * * In addition, it is set as the URL generator's root namespace. * * @var string */ protected $namespace = 'App\Http\Controllers';

/**
 * Define your route model bindings, pattern filters, etc.
 *
 * @return void
 */
public function boot()
{
    //

    parent::boot();
}

/**
 * Define the routes for the application.
 *
 * @return void
 */
public function map()
{
    $this->mapApiRoutes();

    $this->mapWebRoutes();

    //
}

/**
 * Define the "web" routes for the application.
 *
 * These routes all receive session state, CSRF protection, etc.
 *
 * @return void
 */
protected function mapWebRoutes()
{
    Route::middleware('web')
         ->namespace($this->namespace)
         ->group(base_path('routes/web.php'));
}

/**
 * Define the "api" routes for the application.
 *
 * These routes are typically stateless.
 *
 * @return void
 */
protected function mapApiRoutes()
{
    Route::prefix('api')
         ->middleware('api')
         ->namespace($this->namespace)
         ->group(base_path('routes/api.php'));
}

}`

afoysal left a reply on Empty Route Files

My route file is like below

enter image description here

php artisan route:list command give me below output

https://i.stack.imgur.com/FHfKt.png

Where can I get route files ? Which controllers are using here ?

Thanks @

afoysal started a new conversation Empty Route Files

My Route files are empty but I am getting output at http://127.0.0.1:8000/login. How it is possible ?

enter image description here

11 Aug
1 month ago

afoysal started a new conversation Iteration In Vue.js

I am taking values from a Modal using below code.

<Modal :show="showModal" @hide="showModal = false" @submitted_job_data ="data_submitted"></Modal>

My Vue.js code is like below

<script>
  import Modal from './Modal';
  export default {
    data() {
      return {
        showModal: false,
        jobs: [],
      }
    },
    components: { Modal },
    methods: {
      data_submitted(value) {
        this.jobs.push(value);
        console.log(Object.values(this.jobs)); 
      }
    }
  }
</script>

I am iterating vales like below

<tbody>
   <tr v-for="job in jobs" :key="job.id">
    <td>
     {{ job[0] }}
    </td>
    <td>
     {{ job[1] }}
    </td>
    <td>
     {{ job[2] }}
    </td>
    <td>
     {{ job[3] }}
    </td>
    <td>
     {{ job[4] }}
     </td>
  </tr>
</tbody>

I am getting console result like below

enter image description here

Why I am getting Getter & Setter instead of value ?

13 Jun
3 months ago

afoysal left a reply on CORS Issue

@B3NDOI - yes, I installed but could not find any solution. Thanks.

afoysal started a new conversation CORS Issue

I am working on a Laravel and Angular project. Project is running well in another Computer but I am getting below error in my Laptop.

enter image description here

Could anyone help me in this regard ?

12 Jun
3 months ago

afoysal left a reply on RelationShip

@MANELGAVALDA - Thanks. Your solution is working.

afoysal left a reply on RelationShip

@MANELGAVALDA - My table name is courses. Thanks.

afoysal left a reply on RelationShip

@WOBBIE - I used this solution. I am getting below error

Illuminate\Database\Eloquent\RelationNotFoundException: Call to undefined relationship [courses] on model [App\Modules\AlAsr\Models\Semester]. in file /var/www/html/alasr/SaaS/vendor/laravel/framework/src/Illuminate/Database/Eloquent/RelationNotFoundException.php on line 34

I have below function in semestercontroller.

public function index(Request $request, $domain) { $semesters = Semester::with('courses')->get(); return response()->json(["semesters" => $semesters, "status"=>200]); }

afoysal started a new conversation RelationShip

I have 2 table semesters and courses. I made a column course_id in semester table. One semester has one course and one course has many semester. How should I write model classes to retrieve semesters?

Thanks.

04 Jun
3 months ago

afoysal left a reply on CORS Issue

Thanks @punksolid . Here is Headers.

enter image description here

afoysal started a new conversation CORS Issue

Previously I fixed CORS issue in another project using this package https://github.com/barryvdh/laravel-cors. But now I could not fix CORS issue in current project. Could anyone help me in this regard ?

enter image description here

30 May
3 months ago

afoysal left a reply on Insert Data In Enum() Field

@MUNAZZIL - @munazzil , What does it mean ?

Here is column details.

https://i.stack.imgur.com/SyFtD.png

afoysal left a reply on Insert Data In Enum() Field

@MUNAZZIL - @munazzil , I am getting same error after creating another table.

afoysal left a reply on Insert Data In Enum() Field

@MUNAZZIL - Thanks @munazzil . Can I copy the table ?

afoysal started a new conversation Insert Data In Enum() Field

I am trying to insert data through postman. My error is like below

"SQLSTATE[01000]: Warning: 1265 Data truncated for column 'salutation' at row 1 (SQL: insert into `students` (`salutation`, `fullName`, `nickname`, `studentId`, `email`, `DOB`, `maritalStatus`, `gender`, `blood_group`, `nationality`, `religion`, `mobileNumber`, `homePhone`, `officePhone`, `emergencyContactNumber`, `present_address`, `permanent_address`, `updated_at`, `created_at`) values (`Mr.`, mouse, hello, laptop, hello, 10/12/2001, Single, Male, A+(ve), dsfsd, 10, mobile, key, 123456, royak, m10, 10, 2019-05-30 10:09:16, 2019-05-30 10:09:16))"

My enum() field is like below

enter image description here

28 May
3 months ago

afoysal left a reply on API Development

@DEVFREY - @devfrey , nothing is logged.

afoysal left a reply on API Development

@CHRISTOPHHARMS - Thanks @christophharms . How can I debug this request ?

afoysal started a new conversation API Development

I am trying to develop an API using Laravel. My code is like below

Route::get('/abcd', function() {
    return response()->json(['name' => 'Abigail', 'state' => 'CA']);
});

enter image description here

But I am getting no output in POSTMAN.

enter image description here

27 May
3 months ago

afoysal left a reply on How Use Different .env File ?

@AURAWINDSURFING - Thanks @aurawindsurfing for your reply. I never worked in several .env file. How to switch between different .env file ? I have to create my own .env file . How I can do this ? Thanks.

afoysal started a new conversation How Use Different .env File ?

I found several .env file in a project . I have to create my own .env file.

How can I use different .env fiile ?

04 Feb
7 months ago

afoysal left a reply on Laravel Project Without Bootstrap Folder

@SERGIU17 - Thanks. It is working.

afoysal left a reply on Laravel Project Without Bootstrap Folder

@SERGIU17 - Laravel version is like below

"name": "laravel/framework", "version": "v4.2.22",

PHP version is like below

PHP Version 5.6.40

afoysal left a reply on Laravel Project Without Bootstrap Folder

@SERGIU17 - Thanks. I am getting error in this line.

$app = new Illuminate\Foundation\Application( $_ENV['APP_BASE_PATH'] ?? dirname(DIR) );

afoysal started a new conversation Laravel Project Without Bootstrap Folder

I have no bootstrap folder in my project folder. I am getting below error.

https://i.stack.imgur.com/Sexlh.jpg