nafeeur10

Member Since 2 Years Ago

Experience Points
18,360
Total
Experience

1,640 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
56
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
18,360 XP
Jan
14
4 days 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
1 week 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
1 week 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
1 week 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
1 week 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
1 week 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
2 weeks 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 weeks 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
4 weeks 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
1 month 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
2 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
2 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
2 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
2 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
2 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.

Activity icon

Started a new Conversation The Response Content Must Be A String Or Object Implementing __toString(), "object" Given.

I am trying to get latest row with where clause and first(). Unfortunately the below query gives me the above error. Can anyone explain me why this error is coming and why first() method is not working with where` clause?

I am trying to get the whole row or it can be the latest id with given ip address.

public function storeLeaveTime()
{
$ip = Request::ip();

$lastid = DB::table('visitors_information')
         ->where('ip', $ip)
         ->latest()
          ->first();

return $lastid;
}

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

Oct
26
2 months ago
Activity icon

Started a new Conversation How To Retrieve JSON Data In Controller: Laravel

I am getting the data with axios like this:

form: {
   email: '',
   name: '',
   subject: '',
   msg: '',
   depart: null,
    issue: null,
    checked: []
},

Form onSubmit this function will execute successfully:

onSubmit(evt) {
        let contactDetails = JSON.stringify(this.form);
        this.$http.post('api/contact/form/submit', { 
            contactDetails
        }).then( (res) => {
            console.log(res);
        }).catch( (err) => {
            console.log(err);
        })
      },

Now getting this value in Controller like this:

$info = $request->input('contactDetails');
        return $info['issue'];

$info is giving me correct values. But why I can't access issue like this?

ERROR: Illegal string offset 'issue

Oct
23
2 months ago
Activity icon

Started a new Conversation [vuex] Unknown Action Type: LanguageFromLocal

I am working with Laravel 6 and Vuejs & Vuex.

I have declared a store to store my language which is coming from localStorage

Please take a look my store file. store/index.js

export default {
    state: () => ({
        lang: 'eng'
     }),
    mutations: { 
        changeLanguage(state, payload) {
            return state.lang = payload
        }
     },
    actions: { 
        languageFromLocal(context) {
            let language = localStorage.getItem('eru-lang');
            context.commit("changeLanguage", language)
        }
     },
    getters: { 
        getLanguage(state) {
            return state.lang
        }
    }
}

Then from Header.vue (Where a dropdown to change the language) I want to access the action to get the language.

Please take a look of Header.vue file

mounted() {
      this.$store.dispatch("languageFromLocal");
 },

methods: {
	onChangeLanguage(event) {
          this.lang = event.target.value;
          this.$store.commit('changeLanguage', this.lang)
      }
}

Mutation is working perfectly but why action is not giving me the above error in console?

Oct
19
2 months ago
Activity icon

Started a new Conversation Vee-Validate Gives "not Valid" Error Against "required" Error!!

I am using vee-validate to validate my Form. I am using this Basic Example. Error is giving Perfectly but gives "not valid" error against "required" error!!

In app.js:

import { ValidationObserver, ValidationProvider, extend } from 'vee-validate';
import * as rules from 'vee-validate/dist/rules';

Object.keys(rules).forEach(rule => {
    extend(rule, rules[rule]);
});

// Register Validation Provider globally
Vue.component('ValidationObserver', ValidationObserver);
Vue.component('ValidationProvider', ValidationProvider);

AddCategory.vue:

<ValidationProvider name="Category Name" rules="required|alpha" v-slot="{ errors }">
    <input 
           v-model="category_name" 
            type="text" 
            placeholder="T-Shirt"
     >
    <span>{{ errors[0] }}</span>
</ValidationProvider>

data:

data() {
    return {
         category_name: '',
    }
},
Oct
14
3 months ago
Activity icon

Started a new Conversation How To Inherit Main App In Laravel Module (L8)

I am using Laravel Module Package (https://github.com/nWidart/laravel-modules)

Suppose, I have....

--------------------------------------------------------------
			navbar
--------------------------------------------------------------

Content

I wan to fixed the layout like `layout.blade.php and want to extend it in Every Modules. For example, I have Category, Content in Navbar. While I will click on Category, Category Module will work.

I want to use Vue. So, how inertiajs will work here??

Sep
25
3 months ago
Activity icon

Started a new Conversation Where Is The App Id In Laravel 8 And Jetstream?

I have installed Laravel 8 and Jetstream.

Here is the code in app.js

require('./bootstrap');

import Vue from 'vue';

import { InertiaApp } from '@inertiajs/inertia-vue';
import { InertiaForm } from 'laravel-jetstream';
import PortalVue from 'portal-vue';

Vue.use(InertiaApp);
Vue.use(InertiaForm);
Vue.use(PortalVue);

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

But I am not getting any app id. Can you help me where it is and from where it is starting?

Sep
21
3 months ago
Activity icon

Replied to Home View Is Not Showing In SPA Laravel Vue

@rahulk,

You are right.

Thanks a lot. :-)

Activity icon

Awarded Best Reply on Home View Is Not Showing In SPA Laravel Vue

Got the answer.

Vue.component('home', require('./components/views/Home.vue').default);
Activity icon

Replied to Home View Is Not Showing In SPA Laravel Vue

Got the answer.

Vue.component('home', require('./components/views/Home.vue').default);
Activity icon

Replied to Home View Is Not Showing In SPA Laravel Vue

@rahulk,

I want to load my Component in that position. Not <router-view />

Giving me an error:

[Vue warn]: Failed to mount component: template or render function not defined.

Activity icon

Replied to Home View Is Not Showing In SPA Laravel Vue

@gymdone,

Laravel Version 7.

@rahulk,

I know it will work. But I don't want to do like this.

Activity icon

Replied to Home View Is Not Showing In SPA Laravel Vue

@sinnbeck,

It's a mistake in posting!

Activity icon

Started a new Conversation Home View Is Not Showing In SPA Laravel Vue

welcom.blade.php

<link href="{{ asset('css/app.css') }}" rel="stylesheet" />
.....
<div class="content w-100" id="app"></div>
....
<script src="{{ asset('js/app.js') }}" defer></script>

web.php:

Route::get('/', function () {
    return view('welcome');
});

app.js

window.Vue = require('vue');
import router from './router/index'


const app = new Vue({
    el: '#app',
    router
});

router/index.js

import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

import Home from '../components/views/Home'
import Cart from '../components/cart/Index'

const routes = [
    { 
        path: '/', 
        component: Home,
        name: 'Home'
    }
]

const router = new VueRouter({
    routes // short for `routes: routes`
})

export default router

Home.vue

<div id="content">
                <router-view></router-view>
</div>

What is the problem?

Sep
17
4 months ago
Activity icon

Replied to How To Work With Separately In Laravel

@automica,

See the entire folder structure of the Theme

https://ibb.co/ZV0Z1q9

Activity icon

Replied to How To Work With Separately In Laravel

@automica,

I didn't add that folder. I have this structured solution.

Activity icon

Replied to How To Work With Separately In Laravel

@automica,

Actually that is not my Question. Please see my example image. Theme is another folder besides Laravel regular Folders. I am finding the way.

Activity icon

Replied to How To Work With Separately In Laravel

@automica,

Not only Two Themes actually. For building Large scale Solution I just need to know the better way. Suppose, If I divide the whole solution into two parts (For Example) like StoreFront and Admin.

All MVC codes of Storefront will stay there and All MVC codes of Admin will stay in Admin Folder.

Something like this.

Activity icon

Replied to How To Work With Separately In Laravel

@automica,

Thank you for your reply. Here is an Example. Where "Theme" is a Folder where all StoreFront Code is situated.

Activity icon

Started a new Conversation How To Work With Separately In Laravel

https://ibb.co/T8xsdWD

I want to work separately. Suppose, I want to build an E-Commerce. Storefront will be SPA and Admin will have Vendor and others system.

What will be the better approach to do this type of development?

Sep
07
4 months ago
Activity icon

Replied to CSRF Token Mismatch In Dropzone.js

@jlrdw,

I saw that. But it is not solving my problem.

Thanks