SafeMood

SafeMood

Member Since 2 Months Ago

Experience Points 1,780
Experience Level 1

3,220 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 7
Lessons
Completed
Best Reply Awards 1
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

25 Apr
1 month ago

SafeMood left a reply on Disable CSRF In Tests

You can disable it for specific routes by modifying

App\Http\Middleware\VerifyCsrfToken

/** * The URIs that should be excluded from CSRF verification. * * @var array */ protected $except = [ 'http://example.com/foo/bar', ];

or in all of ur project app>Http>Kernel.php

/**
 * The application's route middleware groups.
 *
 * @var array
 */
protected $middlewareGroups = [
    'web' => [
        \App\Http\Middleware\EncryptCookies::class,
        \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
        \Illuminate\Session\Middleware\StartSession::class,
        // \Illuminate\Session\Middleware\AuthenticateSession::class,
        \Illuminate\View\Middleware\ShareErrorsFromSession::class,
      //  \App\Http\Middleware\VerifyCsrfToken::class,
        \Illuminate\Routing\Middleware\SubstituteBindings::class,
    ],

but it's not a good thing to do

take a look to docs

https://laravel.com/docs/5.8/csrf

24 Apr
2 months ago

SafeMood left a reply on How To Make A Dynamic Category Tree In The Route?

@ME10071990 - @me10071990

in ur controller

you should have a method to get that parameter

public function show($category) {

    $category = Category::where('category', $category)->first();

    return view('category', compact('category'));

}

ur link it will be something like that

<a href="route('category.show',[$'category'])

23 Apr
2 months ago

SafeMood left a reply on Ajax Response "Malformed UTF-8 Characters, Possibly Incorrectly Encoded"

Hi @codebullet

change with this

return response()->json(['properties' => $properties]);

SafeMood left a reply on How To Prevent From This Javascript From Load ?

make a send button its better u dont want to send request to server in every change

or if u do

use

onblur event for both fields if user leave both fields then u make a post

SafeMood left a reply on Creating A Contact Form Without Controllers And Migrations

@roottech

u need to do that in the clientside

there is

https://smtpjs.com/

u can use it but i don't know if they are trustworthy u can try it with a fake email

SafeMood left a reply on (1/1) BadMethodCallException Call To Undefined Method Illuminate\Database\Query\Builder::relationPaie()

@mouzak

Error say must be of the type array, string give

try this

save(new Paie(array($attributes)));

SafeMood left a reply on Voyager Vs Nova

@michalis ur welcome

yes u need to migrate your database cuz if u didnt all your settings will be lost it will return to default settings (voyager settings) i didn't try nova yet but in any app to save things u need database always there is default settings then u make ur own custom this why u will need seeders to save your settings if u want u cant save ur content too

See this video to learn more about seeders

https://www.youtube.com/watch?v=U5gxiPNcSZU

SafeMood left a reply on How To Make A Dynamic Category Tree In The Route?

@ME10071990 - ur welcome any time :D

if u have multiple designs for every category so u need to hve multiple views category

in conroller

for every category return the view belongs to it

SafeMood left a reply on JQquery Loader Works Only On The First Ajax Call

success: function (data) { if (data.success) { callback(data.html); }

// so here u need to recall that jquery.loder again },

SafeMood left a reply on How To Prevent From This Javascript From Load ?

put it inside a event

like

$( "#target" ).click(function() { /your code });

SafeMood left a reply on File_put_contents In Framework/views Failed To Open Stream: No Such File Or Directory

@ try to access that folder and do it manually and see how it goes

SafeMood left a reply on How To Make A Dynamic Category Tree In The Route?

hi @alex_storm

u need to pass category in your route as a parameter

like

Route::get('/{category}, '[email protected]')->name('category.show');

in ur controller u can handle this request

check the database

get data

and return ur view if u found that category or do abort(404)

SafeMood left a reply on JQquery Loader Works Only On The First Ajax Call

@jacobs

when u refresh the page it work again right ?

SafeMood left a reply on How Much Of Code Syntax You Guys Remember?

its ok we all forget thank god now we have IDE there is always a new ways to do stuff coz we code while we are thinking syntax will always change wt u should remember is algorithms logic this something alaways will stay with u

SafeMood left a reply on Changing Route Parameter In Current Route And Display The 'new' Url

hi @richardv

// if i did understand wt u want

if u have this in ur route /{locale}/{company}/{id}

so ur link need to be like this

href="{{route('YOUR_ROUTE',[ Request::segment(1) ,Request::segment(2),Request::segment(3)])}}"

SafeMood left a reply on JQquery Loader Works Only On The First Ajax Call

hi @jacobs

u need to recall ur js after ajax sucess

SafeMood left a reply on Voyager Vs Nova

Hi @michalis

yes all ur setting will be stored in the database and i think all of them do that

or where they can save data ?!

but this probleme can be solved with seeders u can use iseed package its perfect for that

iSeed

nova is very good too

but u can use voyager i did use it in a project it work perfectly fine

documentations are available and good for both of them

22 Apr
2 months ago

SafeMood left a reply on How To Add A Foreign Key To A Table After Migration Done Laravel

@MKBAT - thnx good pointing

but runnig rollback will erase data coz it will drop last migrations

i hope it work for him

SafeMood left a reply on How To Add A Foreign Key To A Table After Migration Done Laravel

@ABDULBAZITH - ur welcome any time

but using sql cmd u will lose your settings by losing the data or changing the environment

SafeMood left a reply on How To Add A Foreign Key To A Table After Migration Done Laravel

@ABDULBAZITH - @abdulbazith

ur welcome

26 tables i guess u should first export ur dataabse as a backup

then u can use iSeed to save ur data in seeders its a laravel package that provides a method to generate a new seed file based on data from the existing database table.

after that make empty ur database dont drop it just select all tables and choose empty

go to ur migration folder and delete all ur migrations

use can now genrate all those migration by "Laravel Migrations Generator"

it Generate Laravel Migrations from an existing database

migrations-generator

php artisan help migrate:generat just use this code

Inverse seed generator (iSeed)

php artisan iseed my_table,another_table put all ur table names that way

Advice: don't play with database in production

21 Apr
2 months ago

SafeMood left a reply on How To Add A Foreign Key To A Table After Migration Done Laravel

@abdulbazith

u can use

php artisan make:migration add_product_category_id_to_product --table=product

if ur other table name is categories

Foreign Key : product_category_id

$table->foreign('product_category_id')->references('id')->on('categories ');

Or can just use

php artisan migrate:rollback

add ur column the same migration then migrate

but this will erase any data in ur table

SafeMood left a reply on Trying To Get Property Of Non-object

@CHRON - hi @chron

if u still having to same prob

just change this part

  • {{ $user->customer->firstname }}
  • to

  • {{ ($user->customer) ? $user->customer->firstname : "" }}
  • SafeMood left a reply on How To Save Multiple Models From One Form

    hi @memele

    u use jQuery serialize() Method

    You can select one or more form elements (like input and/or text area), or the form element itself.

    take a look here https://www.w3schools.com/jquery/ajax_serialize.asp

    this may help u too

    https://www.codeproject.com/Questions/330925/access-serialize-jquery-in-php

    another example with a demo

    https://www.tutorialspoint.com/online_jquery_editor.php

    20 Apr
    2 months ago

    SafeMood left a reply on Javascript Event Listener Value Does Not Working

    @sergiu17

    yes ur right i did miss that :v

    he should test to check if the value is set or not

    SafeMood left a reply on Javascript Event Listener Value Does Not Working

    @tahsan

    u can add a hidden input to save data in it

    document.getElementById("wrap").addEventListener('click',()=>{ var data=document.getElementById("wrap").checked; document.getElementById("hiddenInput").value = data ; }); console.log(document.getElementById("hiddenInput").value);

    SafeMood left a reply on Where Are You All From?

    Hello From Tunisia :D

    SafeMood left a reply on Add Image As Background

    @aishahyaacob

    go to the front and inpect this image and see how the url look like

    SafeMood left a reply on Add Image As Background

    hi @aishahyaacob

    Put images in ur public folder

    make sure that u did run this cmd " php artisan storage:link "

    Css :

    background-image: url("{{asset('sms/image.jpg')}}");

    sms folder should realy exist inside the public folder

    hope this help u