successdav

successdav

Member Since 9 Months Ago

Experience Points 5,570
Experience Level 2

4,430 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 16
Lessons
Completed
Best Reply Awards 2
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.

14 Jul
1 day ago

successdav left a reply on All Ajax Post Request Not Going Through

Hi, This might help you help me debug this error. Here is the error generated on the console headers tab

Request URL: http://success.test/threads/laravel/the-quick-brown-fox-jumps-over-the-lazy-dog/replies
Request Method: POST
Status Code: 419 unknown status
Remote Address: 192.168.10.10:80
Referrer Policy: no-referrer-when-downgrade

Preview tab

{message: "", exception: "Symfony\Component\HttpKernel\Exception\HttpException",…}
exception: "Symfony\Component\HttpKernel\Exception\HttpException"
file: "/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php"
line: 203
message: ""
trace: [{,…},…]

successdav left a reply on All Ajax Post Request Not Going Through

Yep I have all of this in place. Axos get request is going fine but Post request is not going through

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- CSRF Token -->
    <meta name="csrf-token" content="{{ csrf_token() }}">

    <title>{{$pageTitle}}</title>

and my bootstrap.js

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';

let token = document.head.querySelector('meta[name="csrf-token"]');

if (token) {
    window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
    console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
};

window.axios.defaults.headers.common = {
    // 'X-CSRF-TOKEN': window.App.crsfToken,
    'X-Requested-With': 'XMLHttpRequest'
};

window.events = new Vue();

successdav left a reply on All Ajax Post Request Not Going Through

I upgraded to 5.6.30 from 5.6

Am using vue and axos for my ajax request. I have not before the upgrade had issue with send post request

successdav started a new conversation All Ajax Post Request Not Going Through

After running an upgrade, I had problems with signing up with normal Laravel Form. When I try it returns 419 status code and after research I solved the problem by adding this code

protected static $serialize = true;

to App\Http\Middleware\EncryptCookies middleware and the signup form completed successfully.

Now am making a post request from Vue and am getting this same 419 status code. All of my Ajax post request are returning same error code.

Can you help me fix this?

successdav left a reply on Route Properly Defined But Still Get HTTP Exception Not Found

error

Error: Call to undefined method Tests\Feature\CreateCourseTest::route()

successdav left a reply on Route Properly Defined But Still Get HTTP Exception Not Found

Yep using it this way works fine.

$response = $this->post('/courses', $course->toArray());

successdav started a new conversation Route Properly Defined But Still Get HTTP Exception Not Found

The Rout with the error

Route::post('/courses', '[email protected]')->middleware('admin')->name('courses.store');

Here are my routes

Route::post('/courses', '[email protected]')->middleware('admin')->name('courses.store');

Route::patch('/courses/{course}', '[email protected]')->middleware('admin')->name('courses.update');

Route::get('/dashboard/courses/create', '[email protected]')->middleware('admin')->name('courses.create');

Route::get('/dashboard/{course}/manage', '[email protected]')->middleware('admin')->name('courses.edit');

Route::get('/dashboard/{course}/publish', '[email protected]')->middleware('admin')->name('courses.publish');

Route::get('/dashboard/{course}/unpublish', '[email protected]')->middleware('admin')->name('courses.unPublish');

The test

public function an_administrator_may_create_new_course()
    {
        $course = $this->publishCourse();
        $this->assertDatabaseHas('courses', ['title' => $course->title]);
    }


public function publishCourse($overrides = [])
    {
        $this->signIn(factory('App\User')->states('administrator')->create());
        create('App\Type');
        $course = make('App\Course', $overrides);
        $response = $this->post(route('courses.store'), $course->toArray());

        return $course;
    }

When I run the test,


1) Tests\Feature\CreateCourseTest::an_administrator_may_create_new_course
Symfony\Component\HttpKernel\Exception\NotFoundHttpException:

/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/RouteCollection.php:179
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Router.php:619
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Router.php:608
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Router.php:597
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
/home/vagrant/Sites/stechmax-website/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php:58
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Sites/stechmax-website/vendor/fideloper/proxy/src/TrustProxies.php:57
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:31
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php:27
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:345
/home/vagrant/Sites/stechmax-website/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:195
/home/vagrant/Sites/stechmax-website/tests/Feature/CreateCourseTest.php:71
/home/vagrant/Sites/stechmax-website/tests/Feature/CreateCourseTest.php:28

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

11 Jul
4 days ago

successdav left a reply on All Of My Vue Componenets No Longer Rendering.

The solution was to add .default to the require statement

Vue.component('Flash', require('./components/Flash.vue').default);

yea like so

06 Jul
1 week ago

successdav left a reply on All Of My Vue Componenets No Longer Rendering.

I have this define on my app.js as

const app = new Vue({

    el: '#app'
});

successdav left a reply on All Of My Vue Componenets No Longer Rendering.

Here is what the console errors displays

[Vue warn]: Failed to mount componenet: template or render function not defined
found in
---> <MegaMenu>
        <Root>

it repeats this message for all my components

Did you remove the root app element? I don't know how to go about this.

successdav started a new conversation All Of My Vue Componenets No Longer Rendering.

when I run npm run dev, it installs vue-template-compiler: 2.6.10 and sass-loader then compiles the code 100% without error but when I refresh the browser all of the vue components on the site no longer renders (I dont see this components on the website).

What am I suppose to do. I have been using vue without the template compiler and everything has been working fine and when this guy shows everything blows up.

Please tell me what am not doing right?. thanks

05 Jul
1 week ago

successdav left a reply on The Page Has Expired Due To Inactivity.

Hello Everyone, Thanks all for your time. The problem was from the upgrade, when I run composer update, it updated my laravel from 5.6 to 5.6.30. After googling the 419 status code, it landed me on this page https://laravel.com/docs/5.6/upgrade and all I needed to do was to add this line of code to

protected static $serialize = true;

And this error has been fixed. now am unto the next error, the composer update just messed up my project leaving me with series of bugs. Once again thanks.

04 Jul
1 week ago

successdav left a reply on The Page Has Expired Due To Inactivity.

Thank you? please which solution actually worked for you?

successdav left a reply on The Page Has Expired Due To Inactivity.

@munazzil I have updated the files but still same error. but on chrome network console here is the request headers. it returns 419.

Request URL: http://stechmax.test/login Request Method: POST Status Code: 419 unknown status Remote Address: 192.168.10.10:80 Referrer Policy: no-referrer-when-downgrade

successdav left a reply on The Page Has Expired Due To Inactivity.

@mahaveer @cronix I have followed the link and have tried all of the solutions none is working.

@cronix the program generate session files stored on storage/framework/sessions and the form displays correction, they is nothing wrong with the view, the error shows up only when I try to submit. and it was not like this when I pushed to github, everything was fine until I git clone from git home, run composer install, composer update and & npm install.

HERE IS MY .env file

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:ml13JDTO5637p0jDOS0hTCETUE5fPZkx8R6eS7KT/ZQ=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=success
DB_USERNAME=homestead
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=9cc551d5e49890
MAIL_PASSWORD=3682dd5ccbc0cf
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-zz1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

AND on the config Session.php I have

*/

    'domain' => env('SESSION_DOMAIN', null),

    /*
02 Jul
1 week ago

successdav started a new conversation The Page Has Expired Due To Inactivity.

I have read a lot of articles and have tried a lot of options but none is working.

I got a new machine, install homestead and laravel, pull my project from github, I run npm install, then composer install, then composer update and npm update, it later shows they are some vulnerabilities with my project so I run npm audit fix --force.

created my .env file, configured my database then I run php artisan key:generate followed by php artisan migrate and the migrate went smoothly without errors. Open the project on the browser and it loads fine but when I try to login it keeps showing this error

The page has expired due to inactivity.

Please refresh and try again.

I have verified and the @csrf token is in place, I have run all of the cache:clear, view:clear, route:clear, composer dump-autoload but none is working.

none of the forms are even working, login, register, comments, none of them are working.

successdav left a reply on Git Clone My Project To A New Pc But Does Not Run

@jlrdw You got it right but you dint point me to where I can find the documentation. nevertheless I got it fixed after hours of googling and as always it turns out the fix was actually a simple one.

If you are facing this issue follow this steps to fix:

  1. after running git clone your project,
  2. Install your npm dependencies
  3. install your composer dependencies
  4. make sure your .env file is setup
  5. runt php artisan key:generate

AND THAT'S IT! You are done.

successdav left a reply on Npm Run Watch Displays Error After Compiling Then Stops Watching

I finally got it fixed by formatting my PC but if you are facing this issue you dont need to format your PC, the problem was from the node. I needed to update my node but unfortunately for me, my PC refused to uninstall the node that was already install.

successdav left a reply on HOW TO CONNECT TO MY SERVER FROM FILEZILLA

@WILK_RANDALL - Yep you are right and I got it figured out. sometimes I just need to do a little thing and googling to figure things out.

I got it solved by following this post

https://www.a2hosting.com/kb/getting-started-guide/accessing-your-account/setting-up-sftp-access-for-multiple-users

All I needed to do was to connect via ssh

successdav started a new conversation HOW TO CONNECT TO MY SERVER FROM FILEZILLA

I setup my server using laravel forge, deployed my site and now my subscription has expired..

I have installed filezilla, where it ask for

Host, I provided the server Ip Address

Username: forge as sent to my gmail from forge

password: provided the sudo password sent to my email from forge

port: i used 3306 this dint workout. I tried: 22 and it printed this error

Response:   fzSftp started, protocol_version=8
Command:    open "[email protected]*****
Error:  Disconnected: No supported authentication methods available (server sent: publickey)
Error:  Could not connect to server

Please How do I connect to this server from filezilla?

01 Jul
2 weeks ago

successdav left a reply on Help With Querys

try this

Model::where(function ($query) {
    $query->where('a', '=', 1)
          ->orWhere('b', '=', 1);
})->where(function ($query) {
    $query->where('c', '=', 1)
          ->orWhere('d', '=', 1);
});

successdav started a new conversation Delete A Directory From Vagrant Box

Vagrant reload --provision, then vagrant ssh. when I ssh into my vagrant box, there is a directory name success, but this directory is not found on my local PC > homestead > project directory. I want to delete this folder from my vagrant box but it repeated says access denied.

how do I do this?

30 Jun
2 weeks ago

successdav started a new conversation Box Laravel/homestead Could Not Be Found

I added the homestead box using windows powershel I box is added to this location on my PC C:\Users\SUCCESS.vagrant.d\boxes\laravel-VAGRANTSLASH-homestead\8.0.0-beta\virtualbox When I run

$ vagrant box list
laravel/homestead (virtualbox, 8.0.0-beta)

It displayed the version as stated above then I run vagrant up

$ vagrant up
Bringing machine 'homestead-7' up with 'virtualbox' provider...
==> homestead-7: Box 'laravel/homestead' could not be found. Attempting to find and install...
    homestead-7: Box Provider: virtualbox
    homestead-7: Box Version: >= 7.2.1, < 8.0.0-alpha1
==> homestead-7: Loading metadata for box 'laravel/homestead'
    homestead-7: URL: https://vagrantcloud.com/laravel/homestead
==> homestead-7: Adding box 'laravel/homestead' (v7.2.1) for provider: virtualbox
    homestead-7: Downloading: https://vagrantcloud.com/laravel/boxes/homestead/versions/7.2.1/providers/virtualbox.box
==> homestead-7: Box download is resuming from prior download progress
    homestead-7: Download redirected to host: vagrantcloud-files-production.s3.amazonaws.com

It looks like it was not able to find the laravel homestead box which i have already added and shows up when I run vagrant box list and its trying to redownload the box again. why is it not using the already downloaded box?

Can you please help me fix this error.

25 Jun
2 weeks ago

successdav left a reply on Npm Run Watch Displays Error After Compiling Then Stops Watching

@BOBBYBOUWMANN - here is what i have at the npm-debug.log file

0 info it worked if it ends with ok
1 verbose cli [ 'C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe',
1 verbose cli   'C:\Program Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'watch' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prewatch', 'watch', 'postwatch' ]
5 info lifecycle @~prewatch: @
6 silly lifecycle @~prewatch: no script for prewatch, continuing
7 info lifecycle @~watch: @
8 verbose lifecycle @~watch: unsafe-perm in lifecycle true
9 verbose lifecycle @~watch: PATH: C:\Program Files (x86)\Nodist\npmv.10.9\bin\node-gyp-bin;C:\Users\SUCCESS\Homestead\Projects\success_techmax\node_modules\.bin;C:\Program Files (x86)\Nodist\v-x64.9.1;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;c:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Users\SUCCESS\homesteadconfig\homestead;C:\Program Files\Git\cmd;C:\Python27;C:\Program Files\Microsoft SQL Server0\Tools\Binn\;C:\Program Files (x86)\Nodist\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files\PuTTY\;C:\Users\SUCCESS\AppData\Local\Programs\Microsoft VS Code\bin
10 verbose lifecycle @~watch: CWD: C:\Users\SUCCESS\Homestead\Projects\success_techmax
11 silly lifecycle @~watch: Args: [ '/d /s /c', 'npm run development -- --watch' ]
12 silly lifecycle @~watch: Returned: code: 1  signal: null
13 info lifecycle @~watch: Failed to exec watch script
14 verbose stack Error: @ watch: `npm run development -- --watch`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (C:\Program Files (x86)\Nodist\npmv.10.9\lib\utils\lifecycle.js:255:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:191:7)
14 verbose stack     at ChildProcess.<anonymous> (C:\Program Files (x86)\Nodist\npmv.10.9\lib\utils\spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:191:7)
14 verbose stack     at maybeClose (internal/child_process.js:877:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid @
16 verbose cwd C:\Users\SUCCESS\Homestead\Projects\success_techmax
17 error Windows_NT 6.1.7601
18 error argv "C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe" "C:\Program Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js" "run" "watch"
19 error node v6.9.1
20 error npm  v3.10.9
21 error code ELIFECYCLE
22 error @ watch: `npm run development -- --watch`
22 error Exit status 1
23 error Failed at the @ watch script 'npm run development -- --watch'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the  package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run development -- --watch
23 error You can get information on how to open an issue for this project with:
23 error     npm bugs
23 error Or if that isn't available, you can get their info via:
23 error     npm owner ls
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

successdav left a reply on Help Me Refactor This Code Its A Bit Lengthy

@KEVINBUI - Nope! we will have to reorder the order number should the user decide to change the appearance of the items, making the last become first and the first become the fourth. will auto increment allow us reoder the field if needed? e.g. we have 5 items and the odering is A = 1, B = 2, C = 3, D = 4, E = 5, F = 6 . now if F is move to become one then i should be. we should now have F = 1, A =2 B = 3, C = 4, D = 5, E = 6.

successdav left a reply on Npm Run Watch Displays Error After Compiling Then Stops Watching

@BOBBYBOUWMANN - and it will finish compiling before displaying this error message

successdav left a reply on Npm Run Watch Displays Error After Compiling Then Stops Watching

@BOBBYBOUWMANN - Can you please look closely at the error generated and help me get back to coding. Am really stock

successdav left a reply on Npm Run Watch Displays Error After Compiling Then Stops Watching

It was working fine two days back. I shut down the PC went for vacation, return back boot up the PC and npm run watch is not running. I run as administrator and tried again same error. How else do I solve this permission issue. I AM USING WINDOWS 7 64 bit OS

24 Jun
3 weeks ago

successdav started a new conversation Npm Run Watch Displays Error After Compiling Then Stops Watching

It compiles up untill 95 percent then displays

DONE Compiled successfully in 32854ms 3:57:42 AM

   Asset     Size  Chunks                    Chunk Names

/js/app.js 1.51 MB 0 [emitted] [big] /js/app /css/app.css 21.3 kB 0 [emitted] /js/app internal/child_process.js:313 throw errnoException(err, 'spawn');

followed this error. I dont understand the error, please if you do help me get a solution thanks


 DONE  Compiled successfully in 32854ms                               3:57:42 AM


       Asset     Size  Chunks                    Chunk Names
  /js/app.js  1.51 MB       0  [emitted]  [big]  /js/app
/css/app.css  21.3 kB       0  [emitted]         /js/app
internal/child_process.js:313
    throw errnoException(err, 'spawn');
    ^

Error: spawn UNKNOWN
    at exports._errnoException (util.js:1026:11)
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:380:9)
    at Object.exports.execFile (child_process.js:143:15)
    at C:\Users\SUCCESS\Homestead\Projects\success_techmax\node_modules\node-not
ifier\lib\utils.js:104:8
    at C:\Users\SUCCESS\Homestead\Projects\success_techmax\node_modules\node-not
ifier\lib\utils.js:111:22
    at FSReqWrap.oncomplete (fs.js:123:15)

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe" "C:\Pro
gram Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js" "run" "development" "--
" "--watch"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin
/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/we
bpack.config.js "--watch"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node
_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/
laravel-mix/setup/webpack.config.js "--watch"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js
--progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config
.js "--watch"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\SUCCESS\Homestead\Projects\success_techmax\npm-debug.log

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files (x86)\Nodist\v-x64\6.9.1\node.exe" "C:\Pro
gram Files (x86)\Nodist\npmv\3.10.9\bin\npm-cli.js" "run" "watch"
npm ERR! node v6.9.1
npm ERR! npm  v3.10.9
npm ERR! code ELIFECYCLE
npm ERR! @ watch: `npm run development -- --watch`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ watch script 'npm run development -- --watch'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the  package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run development -- --watch
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\SUCCESS\Homestead\Projects\success_techmax\npm-debug.log

C:\Users\SUCCESS\Homestead\Projects\success_techmax>
13 Jun
1 month ago

successdav left a reply on Help Me Refactor This Code Its A Bit Lengthy

@KEVINBUI - Nice rewrite thanks. But what if the already exist an item with an order of 2; we will want the IncrementOrderIfNeeded method to increment to 3 and so on. does the IncrementOrderIfNeeded carry out this functionaly?

02 Jun
1 month ago

successdav started a new conversation Help Me Refactor This Code Its A Bit Lengthy

All am doing is: When creating a new learn and setting the order number, check to see if there already exists an item with that order if so increment the order.

The code achieve the end goal but I know it can be written better

here is my code

Store method in Controller:

public function store(Course $course, Request $request)
    {
        $this->validate(request(), [
            'body' => 'required|spamfree',
        ]);
        
        $learn = Learn::addLearn([
            'body' => request('body'),
            'course_id' => $course->id
        ]);
        return $learn;
    }

Logic to persist to database on Learn Model

static public function addLearn($learn)
    {
        $order = 1;
        if(static::whereOrder($order)->exists()){
            $order = self::incrementOrder($order);
        }

        $learn = self::create([
            'body' => $learn['body'],
            'course_id' => $learn['course_id'],
            'order' => $order
        ]);

        return $learn;
    }

    static public function incrementOrder($order)
    {
        while(static::whereOrder($order)->exists()) {
            $order++;
        }

        return $order;
    }

successdav left a reply on The Return Model Does Not Include Some Fields On One To Many Relationship

@BOBBYBOUWMANN - Yep it works and that was incredibly fast reply. Thanks Sir.

successdav started a new conversation The Return Model Does Not Include Some Fields On One To Many Relationship

I have a one to many relationship between Course and learns Models, the learns has the following column 'id', 'course_id', 'body', 'order' When I insert into this learn table and use the return $learn statement the 'body' column does not get included; But when I boot up tinker and fetch the model it gets included. Thanks for your help

Migration Class

Schema::create('learns', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('course_id')->index();
            $table->string('body');
            $table->integer('order'); //This field does not get return
            $table->timestamps();
        });

Course Model Relationship

public function learns()
    {
        return $this->hasMany('App\Learn');
    }

Here is my Controller

public function store(Course $course, Request $request)
    {
        $this->validate(request(), [
            'body' => 'required|spamfree'
        ]);
        
        $learn = $course->addLearn([
            'body' => request('body')
        ]);
        return $learn;
    }

the learn gets saved successfully but the return statement

return $learn;

data does not contain order column when view on the Network Console

01 Jun
1 month ago

successdav left a reply on CONFUSE ON HOW TO SET THIS TABLES UP, I NEED HELP

@SNAPEY - Do you know of any Draggable UI component I can use with vuejs?

07 May
2 months ago

successdav left a reply on Help Me Get Algolia To Work On My Site

@EHBEN - Just check your network connections

06 May
2 months ago

successdav left a reply on Vue-js Modal Opens The Both Modals At The Same Time

Thanks it works like perfectly like magic

01 May
2 months ago

successdav started a new conversation Issue With Vue-js Modal

I am using vuejs modal and zurb foundation

When the vuejs modal component is open, using some keys in a form input e.g. the space bar input causes the page itself to scroll thereby removing focus from the modal.

and in some cases using the arrow keys toggles the dropdown menu in the form itself

anyone has faced this problem ... or am doing something wrong?

successdav started a new conversation Vue-js Modal Opens The Both Modals At The Same Time

Hi. I am using a plugin vue-js modal https://github.com/euvl/vue-js-modal

I setup a modal like so

<template>
    <div>
        <a @click="$modal.show('test')">BUTTONS</a>

        <modal name="test" height="auto" draggable=".window-header">
            <div class="window-header">DRAG ME HERE</div>
        </modal>
    </div>
</template>

<script>
    export default {
        
    }
</script>

Now when I place the button to launch the modal two on same page

    <testing></testing>
    <p>another button here</p>
    <testing></testing>

clicking on one of the buttons launch the modal twice, its like the two buttons are firing at thesame time. but I really want only one modal launched

how do I fix this.. thanks..

23 Apr
2 months ago

successdav left a reply on Register With Either Phone Or Email

@MARTINBEAN - Thanks for your prompt reply...

but what service will I use to send the confirmation code? I have checked google and there are so many options I just need a simple and good one.

secondly cant I use a single input field for the process? take facebook for example.. isnt this possible?

successdav started a new conversation Register With Either Phone Or Email

Can you please guide me on how to setup a registration system where the user can use an email or a phone number in place of email to register. e.g.

Enter your email or Phone

If the user provides an email - I have already setup a script to send the user and email using mailgun.

but if the user provides a phone.. I should be able to detect and send the user a token to confirm the phone number.

In summary what I need is:

  1. Unlike mailgun, what service do I use to send confirmation code
  2. How do I configure the register process to detect if the user typed in a number or email so to enable me post to the right column in my table.

Thanks for your time

22 Apr
2 months ago

successdav left a reply on Unable To Connect To Mysql From Mysql Workbench

@CRONIX - Thanks alot.. I actually got to make it work.... funny enough that I wasnt patient enough to thoroughly go through the settings you sent me and I was missing the General Settings tab section. I keep using General setting for SSH settings and this has cost me a week and 3 days... Thanks anyway

21 Apr
2 months ago

successdav left a reply on Page Loads On My Machine But Return 500 Error Online

@ASHRAAM - how do I get there? the site is running online

successdav started a new conversation Page Loads On My Machine But Return 500 Error Online

Hi! My app /dashboard page loads fine on my machine (www.stechmax.com/dashboard)

But online it returns whoops something went wrong and when I check the network tab it returns 500 error code.

I have redeployed the app, still no fix... Try changing somethings, still doesn't fixed

any help

20 Apr
2 months ago

successdav left a reply on Where Are You All From?

Hello from Nigeria.

successdav left a reply on App Deployed. Yea! So Happens If I Add New Column To User Db

@SERGIU17 - Thanks ... I have been thinking this all day, but now I know how it works. Once again, thanks.

successdav left a reply on Add Image As Background

@AISHAHYAACOB - cannot find the image in the specified path

successdav left a reply on Display 4 Layers Of One To Many Relationships In A Single View

try this

@foreach($forms as $form)
    <a href="/forms/{{ $form->id }}">{{ $form->question }}</a>

    <span>
        @foreach($form as $sub_section)
            <a href="$sub_section->id">{{$sub_section->title}}</a>
                
                //and you can continue nesting deep

        @endforeach
    </span>

@endforeach

also you may want to add something like a path() method to your model that generate the path to the model

public function path()
    {
        return '/forms/' . $this->section->id
    }

successdav left a reply on Add Image As Background

how is your folder setup? -Root - - images - - - photo.jpg

- - index.php
-- application.css

if this is your setup then use this

background-image: url("../sms/image.jpg")

or just try adding .. at the beginning