nafeeur10

Software Engineer at Sheba Platform Limited

Member Since 2 Years Ago

Dhaka

Experience Points
19,400
Total
Experience

600 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
57
Lessons
Completed
Best Reply Awards
3
Best Reply
Awards
  • start your 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-in-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 Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist 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.

  • Community Pillar

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

Level 4
19,400 XP
Apr
10
1 day ago
Activity icon

Started a new Conversation How To Use Helper Function Directly In Blade In Laravel 6

I have a helper function. I want to use it from my blade view. But it's not getting. Giving me error: Call to undefined function ........

Helper Function Location:

App
     Helpers
          Currency
               currencyhelper.php

I have registered it correctly. From controller it's getting perfectly.

Now what can I do?

Apr
06
5 days ago
Activity icon

Started a new Conversation Better Way To Use ModelResource In Laravel

I have two models:

Order
OrderProducts

Every order has many Products. So, I created a relationship between them. Code is given below.

public function items()
{
        return $this->hasMany(OrderProducts::class);
}

My Data List:

 "order": {
        "id": 10789,
        "previous_order_id": null,
        "partner_wise_order_id": 31,
        "customer_id": 366,
        "items": [
            {
                "id": 1,
                "order_id": 10789,
                "name": "Apple",
                "sku_id": 1,
                "details": null,
                "quantity": "10.00",
                "unit_price": "10.00"
            },
            {
                "id": 2,
                "order_id": 10789,
                "name": "Mango",
                "sku_id": 2,
                "details": null,
                "quantity": "10.00",
                "unit_price": "20.00"
            }
        ]
    }

Now, I don't want to pass all data of a single item. I want to filter them to pass with an Order. Like, I just want to pass name, quantity and unit_price

How will I do that? I can filter the order with OrderResource. Within that how will I filter items?

class OrderResource extends JsonResource
{
    public function toArray($request)
    {
        return [
            'id'                      => $this->id
            'items'                   => $this->items // Here I need filter
        ];
    }
}
Apr
02
1 week ago
Activity icon

Started a new Conversation Helper Function Is Not Loading In Laravel

I have created a helper function in app/Helpers/Dashboard/profitCalculation.php in this path.

This is my Function:

function quarterCalculation($start_date, $end_date)
{
   return true;
}

I have added this file path in composer.json

"autoload": {
"files": [
            "app/Helpers/Dashbaord/profitCalculation.php"
        ]
}

Then I gave composer-du, composer update but nothing is working. Giving me this error:

Script Illuminate\Foundation\ComposerScripts::postAutoloadDump handling the post-autoload-dump event terminated with an exception


  [ErrorException]
  require(D:\xampp\htdocs\app\vendor\composer/../../app/Helpers/Dashbaord/profitCalculation.php): failed to open stream: No such file or directory  
Mar
15
3 weeks ago
Activity icon

Started a new Conversation Guzzle HTTP Give Me Error

Trying to upload file:

private function getOptions($data = null)
{
        $options['multipart'] = [
            [
                'name' => 'name',
                'contents' => $data['name']
            ],
            [
                'name' => 'description',
                'contents' => $data['description']
            ],
            [
                'name' => 'is_published',
                'contents' => $data['is_published']
            ],
            [
                'name' => 'thumb',
                'contents' => base64_encode(file_get_contents($data['thumb']))
            ]
        ];

        return $options;
    }

From where I am calling this, it is giving me data like this:

dd($this->getOptions($data));

Image of given data: https://ibb.co/9Tk38Vh

URL is giving me correct URL. But why internal server error!!

dd($this->client->request(strtoupper($method), $this->makeUrl($uri), $this->getOptions($data)));

https://ibb.co/dPztYbj

What could be the problem?

Activity icon

Replied to How To Setup Guzzle HTTP To Send File?

Anyone here to answer??

Mar
14
4 weeks ago
Activity icon

Replied to How To Setup Guzzle HTTP To Send File?

@snapey, I will upload data from a Website but data will processed to another Website. This code is firing from First Website.

2nd website is not getting Image.

Activity icon

Started a new Conversation How To Setup Guzzle HTTP To Send File?

I am configuring my Guzzle Request like this:

try {
   return json_decode($this->client->request('POST', https://example.com/store, $this->getOptions($data))->getBody()->getContents(), true);
        } catch (GuzzleException $e) {
               echo $e;
}

Set up my Header and Data like this:

private function getOptions($data = null)
{
        $options['headers'] = [
            'Content-Type' => 'multipart/form-data',
            'Accept'       => 'application/json'
        ];
        if ($data) {
            $options['form_params'] = $data;
            $options['json']        = $data;
        }
        return $options;
}

File is not sending. What is the problem?

Mar
10
1 month ago
Activity icon

Replied to How To Check The Property Is File Or Not

@jlrdw, I am taking like this which I mentioned in my code example:

$file = $request->thumb;

Now, how will I apply hasFile() function in $file?

Mar
09
1 month ago
Activity icon

Started a new Conversation How To Check The Property Is File Or Not

I have a POST request. After getting the request I am setting their value like this:

$option = Creator::setThumb($request->thumb)
            ->create();

Set Thumb value:

class Creator {
   protected $thumb;

   public function setThumb($thumb)
    {
        $this->thumb = $thumb;
        return $this;
    }


}

Now, In create I want to check the thumb is file or not. How will I do it?

public function create()
{
        if(file($this->thumb)) {
           return "YES";
        }
}
Feb
24
1 month ago
Activity icon

Started a new Conversation Paginate With Offset And Limit In Laravel 8

https://laravel.com/docs/8.x/pagination#converting-results-to-json

Here is the result in json.

{
   "total": 50,
   "per_page": 15,
   "current_page": 1,
   "last_page": 4,
   "first_page_url": "http://laravel.app?page=1",
   "last_page_url": "http://laravel.app?page=4",
   "next_page_url": "http://laravel.app?page=2",
   "prev_page_url": null,
   "path": "http://laravel.app",
   "from": 1,
   "to": 15,
   "data":[
        {
            // Record...
        },
        {
            // Record...
        }
   ]
}

I want to customise the from, to and other fields. How it is possible to do?

Feb
22
1 month ago
Activity icon

Started a new Conversation How To Get Latest() With Paginate()

I have a BaseRepository where I write a paginate()

protected $model;

public function __construct($model)
{
     $this->model = $model;
}

public function paginate($perPage = 15, $columns = ['*'])
{
     return $this->model->paginate($perPage, $columns);
}

Now I want latest but how I will apply it?

class CollectionRepository extends BaseRepository
{
  public function getAllCollection()
  {
        $latest = $this->model->latest();
        return $this->paginate(5);
  }
}
Feb
16
1 month ago
Activity icon

Started a new Conversation SQLSTATE[HY000] [2002] Connection Refused Laravel Docker

I am trying to migrate my database. Giving this error.

I got in docker this error:

Error starting userland proxy: listen tcp4 0.0.0.0:3306: bind: address already in use

Then I kill this port:

sudo kill `sudo lsof -t -i:3306``

Now, I am using this port to connect my db:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=inventory
DB_USERNAME=root
DB_PASSWORD=root

docker-compose.yml

database:
    image: mysql:5.7.22
    restart: always
    container_name: mysql-database
    command: mysqld --sql_mode=""
    volumes:
      - "./data/db:/var/lib/mysql"
    environment:
      MYSQL_DATABASE: ${MYSQL_DATABASE}
      MYSQL_USER: root
      MYSQL_PASSWORD: 123456
      MYSQL_ROOT_PASSWORD: root
    ports:
      - 3306:3306
    networks:
      - development_network

Now, how can I solve this problem?

Feb
15
1 month ago
Activity icon

Started a new Conversation What Will Be The Return Type For Model In Repository?

I am creating Repository like this:

<?php

namespace App\Repositories;

use App\Models\Collection;


class CollectionRepository extends BaseRepository
{
    public function model()
    {
        return Collection::class;
    }
}

Here Compiler Intelligence giving me an warning to mention the return type. Why I need this and what will be the return type?

Feb
13
1 month ago
Activity icon

Started a new Conversation Delete Method Is Not Supported But Delete Is Working

I am trying to delete a row with ajax.

<form action="{{ route('incoming.destroy', $incoming->id) }}" id="incomingDeleteForm{{ $incoming->id }}"">
     <input type="hidden" name="_token" value="{{ csrf_token() }}">
     <button type="submit" data-id="{{$incoming->id}}" class="incomingDeleteButton"></button>
</form>

Ajax Call:

$(".incomingDeleteButton").on('click', function(e){
    e.preventDefault();

    let id = $(this).data('id');
    let _token   = $('meta[name="csrf-token"]').attr('content');
    Swal.fire({
        title: 'Are you sure ?',
        text: "You won't be able to revert this !",
        icon: 'warning',
        showCancelButton: true,
    }).then((result) => {
        if (result.isConfirmed) {
            $.ajax({
                url: "/client/incoming/" + id,
                type: "DELETE",
                data: { id: id, _token: _token },
                success: function() {
                    alert("Success!");
                }
            })
        }
    })
})

Route:

Route::resource('incoming', 'IncomingController');

What is the problem? And for using resource controller, I have 2 route in the same name just type is different.

Feb
06
2 months ago
Activity icon

Replied to Class 'RealRashid\SweetAlert\SweetAlertServiceProvider' Not Found

cache cleared

All are done what you mentioned but not working!

Activity icon

Replied to Class 'RealRashid\SweetAlert\SweetAlertServiceProvider' Not Found

NO. It's not working! In Controller I have to add this:

use RealRashid\SweetAlert\Facades\Alert;
Activity icon

Started a new Conversation Class 'RealRashid\SweetAlert\SweetAlertServiceProvider' Not Found

I am using this Sweet Alert in Laravel 6: https://realrashid.github.io/sweet-alert/

In localhost all are working well but giving the above problem in live server.

I have added all of realrashid folder in vendor. Added

RealRashid\SweetAlert\SweetAlertServiceProvider::class, in app.php file. Also added Alert alias as the documentation guide me.

Uploaded sweetalert.php in config and view folder.

What could be the problem?

Jan
14
2 months ago
Activity icon

Replied to How To Authorize API In Laravel 8

@martinbean,

Actually, Client will use the API that's true. So that I am building API. :-P But the question is not related to Client Side.

https://laravel.com/docs/8.x/sanctum#issuing-mobile-api-tokens

Here token is saving to database?

$user->createToken($request->device_name)->plainTextToken;

I want to save this info during User login.

Activity icon

Replied to How To Authorize API In Laravel 8

@martinbean, Well, I just building API. No interact with Client-Side. I want to secure my API. I want to save my token into database during user login. So that no unauthenticated user could get my API. Every request will be authenticated via token.

Jan
11
3 months ago
Activity icon

Replied to How To Authorize API In Laravel 8

But I want to pass this save this token into database with Login Method. Is it possible?

Activity icon

Started a new Conversation How To Authorize API In Laravel 8

I am using Jetstream to authentication scraffold.

Now, I want to use Sanctum Package to Authorize my API.

But how will I save my token?

I didn't find any clear instruction.

In documentation there is a issuing system: https://laravel.com/docs/8.x/sanctum#issuing-mobile-api-tokens

But I want to do it while user will login I want to save the token.

How can I do it?

Activity icon

Started a new Conversation API Data Is Not Loading In Laravel 8

I am using Laravel 8. With it I am using Laravel Modules. Link: https://github.com/nWidart/laravel-modules

I have installed Laravel 8 basic Auth System with Jetstream - Inertia - Sanctum

I have made a Route but I can't access the data. When I am hitting/testing the url it's redirect me to the dashboard page.

I got this from php artisan route:list

Method
GET|HEAD 

URL:
api/category                   

Name:
category.index                  

Controller:
Admin\Category\Http\Controllers\[email protected]          

Middleware:
App\Http\Middleware\Authenticate:sanctum

My API:

Route::middleware('auth:sanctum')->group(function () {
    Route::apiResource('category', 'CategoryController');
});

Category Controller:

public function index()
    {
        return response()->json([
           'category' => 1 
        ]);
    }

Giving 302 Found Error!

Jan
09
3 months ago
Activity icon

Started a new Conversation CSRF Token Mismatch.

I am using Axios to Post my data to Laravel Controller.

I have used this below code to resolve the problem. But it's not working!

window.axios = require('axios');
Vue.prototype.$http = Axios;

window.axios.defaults.headers.common = {
    'X-Requested-With': 'XMLHttpRequest',
    'X-CSRF-TOKEN' : document.querySelector('meta[name="csrf-token"]').getAttribute('content')
};

This is my Method which I want to Post:

 onSubmit(event) {

      event.preventDefault();

      this.$http.post('store', {
        email: this.newsletterEmail
      }).then( (res) => {
        console.log(res.data.newsletter_success)
      }).catch( (err) => {
        console.log(err);
      })
    }

What is the problem??

Jan
07
3 months ago
Activity icon

Replied to Update Is Not Working With Ajax Request In Laravel

I know about this error!

I get data in formData but it's not passing to Laravel Controller. Need to find this issue.

Activity icon

Replied to Update Is Not Working With Ajax Request In Laravel

Updated. Request data is empty!!!!

Activity icon

Started a new Conversation Update Is Not Working With Ajax Request In Laravel

Error: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'dept_faculty' cannot be null

My Update Form:

<form id="facultyDeptUpdateFrom" enctype="multipart/form-data"> 

       <input type="hidden" value="{{ $dept_details->id }}" id="DeptID">

       <div class="form-group">
       <select class="form-control" name="faculty_selection" id="faculty_selection">
        <option>Select a Faculty</option>
        @foreach($allFaculty as $faculty)
          <option value="{{ $faculty->id }}" {{ ( $faculty->id == $dept_details->dept_faculty ) ? 'selected' : '' }}>{{ $faculty->home_faculty_title }}
         </option>
        @endforeach
       </select>
      </div>

      <div>
          <input class="btn btn-danger" type="submit" value="{{ trans('global.save') }}">
      </div>
</form>

Ajax Call:

$("#facultyDeptUpdateFrom").on('submit', function(e) {
        e.preventDefault();

        var formData = new FormData(this);
        let id = $("#DeptID").val();

        $.ajax({
            url: "/admin/department/" + id,
            type: 'PUT',
            data: formData,
            dataType:'JSON',
            contentType: false,
            processData: false,
            headers: {
                'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
            },
            success: function(response) {
                toastr.success(response.success);
                setTimeout(function(){
                    window.location.href = "/admin/department";
                }, 5000);
            },
            error: function(error) {
                console.log("Error: ", error.response);
            }
        })
});

Controller:

public function update(Request $request, $id)
{
        $dept = FacultyDept::findOrFail($id);
       $dept->dept_faculty = $request->faculty_selection;

	$dept->save();

        return response()->json([
            'success' => 'Department updated successfully'
        ]);
}

web.php

Route::resource('department', 'FacultyDeptController'); // under admin middleware

What is the problem I can't figure out actually!

Jan
06
3 months ago
Activity icon

Awarded Best Reply on How To Convert Quill Rich Text Data From Database To Normal Text In Vuejs

Solved my problem.

  1. Save data as innerHTML
  2. Then <div v-html="content"></div>

Solved!

Activity icon

Replied to How To Convert Quill Rich Text Data From Database To Normal Text In Vuejs

Solved my problem.

  1. Save data as innerHTML
  2. Then <div v-html="content"></div>

Solved!

Activity icon

Started a new Conversation How To Convert Quill Rich Text Data From Database To Normal Text In Vuejs

Quill Rich text give this type of data.

{"ops":[{"insert":"amar sonar bangla"},{"attributes":{"header":1},"insert":"\n"},{"insert":"\n"},{"attributes":{"bold":true},"insert":"ami tomay valobashi"},{"insert":"\n\n"},{"attributes":{"bold":true},"insert":"oh"},{"attributes":{"list":"ordered"},"insert":"\n"},{"attributes":{"bold":true},"insert":"hjlohj"},{"attributes":{"list":"ordered"},"insert":"\n"},{"attributes":{"bold":true},"insert":"33klljk"},{"attributes":{"list":"ordered"},"insert":"\n"}]}

Data will come from Database. I can save data from Quill to Database.

Now how can I convert them into normal real text in Vuejs?

Jan
05
3 months ago
Activity icon

Started a new Conversation How Can I Give Multiple Condition In @can Laravel

I am handling Authentication with Gate.

@can('user_manage')

@endcan

I have two role one is user_manage another is client_manage

How can I give and and or condition within @can like

@can('user_manage' && 'client_manage')

@endcan

Is it possible?

Jan
03
3 months ago
Activity icon

Started a new Conversation How To Load Vue Component With InertiaJS In Laravel 8 Modules

Working with Laravel Modules Package (https://github.com/nWidart/laravel-modules)

In Laravel 8 we can load Component with Inertiajs

We initialize Inertia in app.blade.php with this @inertia

After that in app.js file, we can initialize it like this:

const app = document.getElementById('app');

new Vue({
    render: (h) =>
        h(InertiaApp, {
            props: {
                initialPage: JSON.parse(app.dataset.page),
                resolveComponent: (name) => require(`./Pages/${name}`).default,
            },
        }),
}).$mount(app);

Then all components will load from the Pages folder.

Now, my question is:

How can I achieve it in a Module? I want to load Vuejs Components using Inertiajs. In module, this Resources/assets/js/app.js file is empty. If I put the above code in it and create a Pages folder but it's giving me error!

import { createApp, h } from 'vue'
import { App, plugin } from '@inertiajs/inertia-vue3'

const el = document.getElementById('app')

createApp({
  render: () => h(App, {
    initialPage: JSON.parse(el.dataset.page),
    resolveComponent: name => require(`./Pages/${name}`).default,
  })
}).use(plugin).mount(el)

In Core ( I made this ) module master.blade.php

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>Module Core</title>
       <link rel="stylesheet" href="{{ mix('css/core.css') }}">

    </head>
    <body>
        @inertia
        <script src="{{ mix('js/core.js') }}"></script>
    </body>
</html>

CoreController:

use Inertia\Inertia;

class CoreController extends Controller
{
    public function index()
    {
        return Inertia::render('Admin/Index');
    }
}

I have a Page in assets/js/Pages/Admin/Index.vue

I want to load this. But giving me error:

[Vue warn]: Error in created hook: "Error: Cannot find module './Admin/Index'"

Dec
24
3 months ago
Activity icon

Started a new Conversation How To Change The Modules "Modules" Folder Name?

I am using Laravel Modules

https://github.com/nWidart/laravel-modules

https://ibb.co/NmXvtkM This is the Folder Structure with Modules.

Is there any way to change it? Like I want to create

Admin\Category

Means my Modules folder name will be Admin

"autoload": {
        "psr-4": {
            "App\": "app/",
            "Modules\": "Admin/",
            "Database\Factories\": "database/factories/",
            "Database\Seeders\": "database/seeders/"
        }
    },

I tried with this but not working!

Thanks

Dec
20
3 months ago
Activity icon

Started a new Conversation Cannot Read Property 'push' Of Undefined In Vuejs

I am using Vue Cli but giving this error! I am trying to Register and then move to Index page. But router is not working here.

In main.js I used router for NProgress, here it is working but why not in this case??

main.js

import Vue from 'vue'
import VueRouter from 'vue-router';
Vue.use(VueRouter);

import router from './Router/routes.js'

import User from './Helpers/User'
window.User = User

new Vue({
  render: h => h(App),
  router,
}).$mount('#app')

User.js

import Axios from "axios";

class User {
    register(data) {
        let uri = 'http://localhost:8000/api/auth/register';
        let self = this;
        Axios.post(uri, data).then((res) => {
            self.$router.push({name:'Index'})
        }).catch( (error) => {
            console.log(error);
        });
    }
}

export default User = new User();

Register.vue

<template>
  <div class="col-md-12">
    <div class="card card-container">
      
      <form name="form" @submit.prevent="handleRegister">
       ----
      </form>
   
  </div>
</template>
<script>
export default {
   data() { return { user: {} }},
   
     methods: {
    handleRegister() {
        this.registration();
      });
    },

    registration() {
        User.register(this.user);
    }
  },
   
}
</script>

routes.js

import components are okay. I also import Vue and VueRouter here.

const routes = [
    //
];

const router = new VueRouter({
    routes
})


export default router

What is the problem here?? router is working in main.js

Giving me error in this line:

self.$router.push({name:'Index'})
Nov
29
4 months ago
Activity icon

Started a new Conversation Quill Editor Icons Are Not Working In Laravel

https://ibb.co/G9pNcL9

Please take a look at the above image. Quill editor is giving me this strange result.

Declaration:

var quill = new Quill('#document-full', {
    theme: 'snow'
 });

Code:

<div class="editor-full">
         <div id="document-full" class="ql-scroll-y" style="height: 300px;">
                <h1>jQueryScript.Net</h1>
          </div>
</div>

Following this documentation: https://www.jqueryscript.net/text/Quill-Editor-Bootstrap-4.html

webpack.mix.js

mix.js([
   'resources/js/app.js',
   'node_modules/bootstrap-quill/bootstrap-quill.js',
   'node_modules/bootstrap-quill/dist/sprite.svg.js'
], 'public/js')
.sass('resources/sass/app.scss', 'public/css');

In app.scss:

@import '~bootstrap-quill/dist/css/quill.css';
@import '~bootstrap-quill/dist/css/quill.snow.css';
@import '~bootstrap-quill/dist/css/quill.bubble.css';

I have linked the app.css and app.js` in right place.

Then why they are not working!

Activity icon

Started a new Conversation Vue Cli Project Is Not Getting CSS In Production Of TailwindCSS

I am working with TailwindCSS. But it's not getting CSS properly. But in development server it is working perfectly.

http://nafee.xyz/dist/

Package.json

{
  "name": "filter",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build --skip-plugins @vue/cli-plugin-eslint",
    "lint": "vue-cli-service lint"
  },
  "dependencies": {
    "autoprefixer": "^9.8.6",
    "core-js": "^3.6.5",
    "postcss": "^7.0.35",
    "tailwindcss": "npm:@tailwindcss/[email protected]^2.0.1",
    "vue": "^2.6.11"
  },
  "devDependencies": {
    "@vue/cli-plugin-babel": "~4.5.0",
    "@vue/cli-plugin-eslint": "~4.5.0",
    "@vue/cli-service": "~4.5.0",
    "babel-eslint": "^10.1.0",
    "eslint": "^6.7.2",
    "eslint-plugin-vue": "^6.2.2",
    "vue-template-compiler": "^2.6.11"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "extends": [
      "plugin:vue/essential",
      "eslint:recommended"
    ],
    "parserOptions": {
      "parser": "babel-eslint"
    },
    "rules": {
      "no-mixed-spaces-and-tabs": 0
    }
  },
  "browserslist": [
    "> 1%",
    "last 2 versions",
    "not dead"
  ]
}

Nov
16
4 months ago
Activity icon

Awarded Best Reply on Message: "CSRF Token Mismatch." Laravel

@mrperfectionist,

Remove data part _token

data: {
    _token: '{{ csrf_token() }}'
},

I hope it will work.

Activity icon

Replied to Message: "CSRF Token Mismatch." Laravel

@mrperfectionist,

Remove data part _token

data: {
    _token: '{{ csrf_token() }}'
},

I hope it will work.

Nov
08
5 months ago
Activity icon

Started a new Conversation Uncaught Error In Dropzone.js In Laravel 6

Uncaught Error: Invalid previewsContainer option provided. Please provide a CSS selector or a plain HTML element.

Giving the above error.

What I have done:

  1. Download dropzone files as zip.
  2. I picked dropzone.min.js files from min folder.

create.blade.php

<form action="/file-upload" class="dropzone">
        <div class="fallback">
            <input name="file" type="file" id="my-background-slider-main-image"/>
        </div>
</form>

In my script:

Dropzone.options.myBackgroundSliderMainImage = {
    paramName: "file", // The name that will be used to transfer the file
    maxFiles: 1,
    init: function () {
      this.on("maxfilesexceeded", function (file) {
        this.removeAllFiles();
        this.addFile(file);
      });
    }
  };

What is my wrong? Why this error is giving in Console?

Nov
01
5 months ago
Activity icon

Started a new Conversation Multiple Contact Email Address In Laravel

I have a Contact Form which has a Dropdown to select Department and Every department has different Email Address.

Now what will be the approach to do that. I can handle to sent Email from same Hosting but here user's Email is not same providers.

What should I do?

Oct
29
5 months ago
Activity icon

Replied to How To Get Data With Custom Condition From Database In Laravel

@tykus and @michaloravec ,

Sorry.

It will be Retrieve Data from Database with this Condition.

Activity icon

Started a new Conversation How To Get Data With Custom Condition From Database In Laravel

I have a entry in database updated_at and another is Current Date.

I want to get data with this condition:

if($current_date - $updated_at <= 2)
{
   return DB rows;
}

How can I get these?

Activity icon

Replied to Route Not Defined.

@robinmvdoorn,

May be you are under a Middleware like admin or others. Then your Route name will be admin.books.show

Or

Run these commands:

php artisan cache:clear
php artisan route:clear
Oct
28
5 months ago
Activity icon

Replied to The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

@michaloravec,

Yes, will it cause any effect on my website performance??

Activity icon

Replied to The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

<script type="text/javascript">
        console.log("Before Working!");

        setInterval(function(){
            $.ajax({
                url: "/visitors/info",
                method: 'GET',
                success: function(res) {
                    console.log("Hitting......", res);
                },
                error: function(err) {
                    console.log("Not Hitting", err);
                }
            })
        }, 10000)
    </script>

Please take a look. You will get the idea. After two minutes I am calling the function to update the database data.

Activity icon

Replied to The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

@michaloravec,

Thank you. Can you please give me the answer of my second part.

" I am hitting (Executing) this Query after two minutes. Will it affect my website Speed or Performance? "

Activity icon

Replied to The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

@michaloravec, There is no other work of it, So, I didn't use Model for this.