MaverickChan

Experience

21,450

6 Best Reply Awards

  • Member Since 11 Months Ago
  • 192 Lessons Completed
  • 0 Favorites

21st March, 2017

MaverickChan left a reply on Show Modal On Redirect • 4 days ago

modal is a part of your whole view file , so , if you wanna show a modal , you need to reload the page first .

i suggest you use jquery to trigger it .

MaverickChan left a reply on MYSQL Not Working In Shared Hosting.. • 4 days ago

based on your operating system , i assume you did not enable your mysqli module in your php 7.

to fix that , go to your php configuration directory , find php.ini , uncomment the module line , restart your server.

you might run a quick test by writing a php file contains phpinfo(); in it , check if mysqli or other mysql works , pdo or something.

if you did not install your php properly , please add some module . on mac or unix , it is easy , but on windows , really tricky.....

good luck

20th March, 2017

MaverickChan left a reply on How To Create A Date Alarm In Laravel 5.3 • 4 days ago

event? i guess

MaverickChan left a reply on Show Modal On Redirect • 4 days ago

add Session::flash('openModal','') in your controller before redeirect

19th March, 2017

MaverickChan left a reply on Dropzone.options - Dropzone Is Not Defined • 6 days ago

dude , i use to have the same problem , after i put the app.js in the header of my html template , all solved.

the reason why it says not defined , because the browser import the dropzone.js before jquery.

18th March, 2017

MaverickChan left a reply on Sweetalert SWAL Is Not Defined - After NPM Install • 6 days ago

save problem , i have to include the js file in the header . but , why can't it be combined with Mix?

MaverickChan started a new conversation How To Include Sweetalert-dev.js In Laravel Mix • 6 days ago

after npm install sweetalert , i have tried :

window.swal = require('sweetalert');

but not working , it says 'swal not defined'

give me some help please.....

8th March, 2017

MaverickChan left a reply on Chinese Characters Shown Everywhere, EXCEPT When Generating To PDF • 2 weeks ago

这是pdf的问题,laravel无解的。导出pdf对中文字符很不友好,没有字库。英文要用css都很麻烦。唯一可能的就是用dompdf做一个图片pdf,但是其实并没有什么用了。。。。。。

20th June, 2016

17th June, 2016

MaverickChan left a reply on Can't Get Host Name Access • 9 months ago

setup hosts file , then setup dns server

MaverickChan left a reply on Non UTF8 Databases • 9 months ago

setup charset in your app/config , then you don't have to iconv in view

15th June, 2016

MaverickChan left a reply on Laravel 5.2 # Appending Values To JSON • 9 months ago

@pmall OK, then @dengdeng i think you should do array_push().

array_push(array ($student), ['is_admin']);

MaverickChan left a reply on Laravel 5.2 # Appending Values To JSON • 9 months ago

@dengdeng

instead of you setting in model like this :

class Student extends Model{
    protected $appends = ['id_admin'];

    public function getIsAdminAttribute($value){
        return $value;
    }
}

change it to

class Student extends Model{
    protected $appends = ['id_admin'];

    public function setIsAdminAttribute($value){
        return $value;
    }
}

14th June, 2016

MaverickChan left a reply on Laravel And JQuery Sortable Returns Null • 9 months ago

where is the csrf token check?

13th June, 2016

MaverickChan left a reply on Why Does Ajax Call Give "Internal Server Error" • 9 months ago

you have a missing ';' in line 1 and line 2

MaverickChan left a reply on Best Practice For Adding Flash Message To Login? • 9 months ago

in your auth controller , after all login methods passed , before redirect. then in your view, check session if has a name , display it .

12th June, 2016

MaverickChan left a reply on Intervention Image - Uploads On One Page • 9 months ago

then create 2 forms

MaverickChan left a reply on Only Display Link If User Has Admin Permission • 9 months ago

@Xaoi check ACL videos here

MaverickChan left a reply on Intervention Image - Multiple Uploads On One Page • 9 months ago

see jeffery's flyers project , use dropzone.js

11th June, 2016

MaverickChan left a reply on How To Write This Associative Query In Laravel 5.2 ? • 9 months ago

it the basic Model issue , read the doc and you will find the solution .

10th June, 2016

MaverickChan left a reply on SPAM Protection? • 9 months ago

what the heck is going on here? some Korean guy?

MaverickChan left a reply on Json_encode Not Working After Upgrade 4.2 To 5.2 • 9 months ago

@wgfamily2006 Text can store 65536 byte and it is a plain format. I am using long text to store Json data now , 4 G.......

MaverickChan left a reply on Json_encode Not Working After Upgrade 4.2 To 5.2 • 9 months ago

@whfamily2006 , i don't know what to say now ...... maybe don't use decode function in controller , combine it in others . return $data directly is not a good idea....

good luck with that

9th June, 2016

MaverickChan left a reply on Interface 'Illuminate\Contracts\Auth\Factory' Not Found • 9 months ago

if you removed the vender directory , it should not work. reinstall composer , reinstall laravel.

MaverickChan left a reply on Returning JSON With Dates And Accessors • 9 months ago

@bradroberts i think you need parse the json data . Maybe json_decode it , turn it into object ,then you can get the date as a string for sure. Or , maybe parse it in jQuery.....

MaverickChan left a reply on Returning JSON With Dates And Accessors • 9 months ago

return new Carbon($value)->toDateTimeString();

MaverickChan left a reply on Json_encode Not Working After Upgrade 4.2 To 5.2 • 9 months ago

@whfamily2006 trust me , you really need to use the second argument. I used to face the same issue. Try:

$data = (array)json_decode($json,true);

convert it to array. you see , "[" means it is a object , so you cannot store it properly in database . it took me a very long night to figure out the way out.

if you still don't wanna do this , you can add a print_r() in your controller to test the decoded data .

trust me , it worths a try.

MaverickChan left a reply on Json_encode Not Working After Upgrade 4.2 To 5.2 • 9 months ago

@whfamily2006 my way is when you do decode:

json_decode($jsonObject,true)

this could make your data as array for sure, then you can do array_push or something you like. then when you need encode,

json_encode($json,JSON_FORCE_OBJECT);

this makes your data json object for sure , you don't have to do any adjustment , the data could be processed in jQuery or php and so on ...

7th June, 2016

MaverickChan left a reply on Whats Missing? Can't Go To Sub Pages • 9 months ago

in ubuntu :

 /etc/apache2 

is the directory where all Apache2.4 conf files located. ls check sites-enabled directory. if you are using just one vps , then edit the 000-default.conf file. edit it with the code i give , adjust with your own settings.

and , be sure , you have your apache rewrite module on . you can check it in your mods-enabled directory . if not , run : sudo a2enmod rewrite then run : sudo service apache2 restart.

MaverickChan left a reply on Problem With Storing Date From Form • 9 months ago

$data->birth = $request->input('birth');

or

'birth' => $request->input('birth'),

assuming you are using a form to input the birthday. maybe you should try some date picker js , save a lot of time

MaverickChan left a reply on Whats Missing? Can't Go To Sub Pages • 9 months ago

check Virtual Host settings

<VirtualHost *:80>
        DocumentRoot "/Library/WebServer/Documents/blog/public"
        ServerName localhost
        <Directory />
                Options FollowSymLinks Multiviews
                MultiviewsMatch Any
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

this works fine on Mac Os , but if you are using Ubuntu , it should be like blow:

<VirtualHost *:80>
        DocumentRoot "/var/www/html/blog/public"
        ServerName localhost
        <Directory /var/www/html/blog/public>
                Options FollowSymLinks Multiviews
                MultiviewsMatch Any
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

otherwise , your rewrite won't work. Don't know why ,some says it only happens in laravel 5.

MaverickChan left a reply on 404 • 9 months ago

me 2 , i have to copy all my replies just in case it go wild.....

6th June, 2016

MaverickChan left a reply on Laravel Rewrite And Lighttpd • 9 months ago

never used lighttpd before. but i can tell you that ubuntu and mac has a slightly different from VPS setup.

check Virtual Host settings

<VirtualHost *:80>
        DocumentRoot "/Library/WebServer/Documents/blog/public"
        ServerName localhost
        <Directory />
                Options FollowSymLinks Multiviews
                MultiviewsMatch Any
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

this works fine on Mac Os , but if you are using Ubuntu , it should be like blow:

<VirtualHost *:80>
        DocumentRoot "/var/www/html/blog/public"
        ServerName localhost
        <Directory /var/www/html/blog/public>
                Options FollowSymLinks Multiviews
                MultiviewsMatch Any
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

otherwise , your rewrite won't work. Don't know why ,some says it only happens in laravel 5.

MaverickChan started a new conversation Json Data Push • 9 months ago

when i create a new post , i store some information in a json format column such as

{"title":"test", "body":"test",.....}   //(first)

what i want is : each time i edit the post , i need this column update like:

{"title":"test", "body":"test",.....},  // (first)
{"title":"test", "body":"test",.....},  // (second)
{"title":"test", "body":"test",.....} ,  // (third)
.
.
.
...

and so on.

how would i do ?

1st June, 2016

MaverickChan left a reply on Homebrew Mysql Install Error • 9 months ago

don't use home-brew to install mysql , for it has some problem in Mac OS X 10.10 and 10.11.

Try downloading mysql 5.7 directly from the website , then install mysql using the dmg.

remember , mark the temp root password , you will need it .

MaverickChan left a reply on Moving Laravel Project Between Servers, Help! • 9 months ago

@jacklara it is your Apache Vhost setup.

<VirtualHost *:80>
    DocumentRoot "/Library/WebServer/Documents/{your project name}/public"
    ServerName localhost
    <Directory />
        Options FollowSymLinks Multiviews
        MultiviewsMatch Any
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

assume you install your project in the local host of course you can change it in you apache conf file as well.

31st May, 2016

MaverickChan left a reply on PDOException]could Not Find Driver(sql Server 2012) • 9 months ago

what's the code in your .env file or database config file? if you can connect your server , then it is not the server problem. please post some code .... in your laravel directory config\database.php something should like below:

'mssql' => [
            'driver' => 'sqlsrv',
            'host' => your host name or ip,
            'port' => '1433',
            'database' => database you want connect,
            'username' => you know,
            'password' => you know,
            'charset' => 'utf8',
            'collation' => '',
            'prefix' => '',
            'strict' => false,
            'engine' => null,
        ]

30th May, 2016

MaverickChan left a reply on Written Exactly Like Jeffrey's Code = ERROR??? • 9 months ago

company is not a method , so like @zachleigh says , try it

MaverickChan left a reply on Problem Sending Mail • 9 months ago

check your spelling .....sometimes , you know why......

MaverickChan left a reply on Moving Laravel Project Between Servers, Help! • 9 months ago

painless way is copy all file of your project to new server , remember , including your vender folder,ALL files needed. then do step 2 like @petrit says : php artisan cache:clear

of course , check your file permissions.

MaverickChan left a reply on L5 W/ Sqlsrv => Using Datetime2 Fields • 9 months ago

convert the datetime into a string format

29th May, 2016

MaverickChan left a reply on Internal Server Error After Cloning From Git To Windows10 • 9 months ago

run

php artisan cache:clear

MaverickChan left a reply on How To Translate The Laravel Error-Message • 9 months ago

@Okey glad i could help

MaverickChan left a reply on Json Parse Error • 9 months ago

use jquery instead .....

MaverickChan left a reply on How To Translate The Laravel Error-Message • 9 months ago

check if you are missing

@endsection 

or

@endforeach 

those would cause your problem

MaverickChan left a reply on Json Parse Error • 9 months ago

@yigitozmen maybe you should process the data in javascript .... or , there is a method

json_encode($data, JSON_FORCE_OBJECT);

MaverickChan left a reply on Json Parse Error • 9 months ago

are you sure the site allow file_get_contents()? maybe move up your dd(),check what you got in the first place

MaverickChan left a reply on Error Message Not Showing • 9 months ago

@Snapey yes , laravel won't do it by default , so nothing's worried ....i think no one would do old password in blade. and browser cache .... nothing is absolutely safe

28th May, 2016

MaverickChan left a reply on Mod- Rewrite .htaccess Rename URL • 9 months ago

@Xaoi , I guess you are using a linux server and the apache conf file is not right.

check Virtual Host settings

<VirtualHost *:80>
        DocumentRoot "/Library/WebServer/Documents/blog/public"
        ServerName localhost
        <Directory />
                Options FollowSymLinks Multiviews
                MultiviewsMatch Any
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

this works fine on Mac Os , but if you are using Ubuntu , it should be like blow:

<VirtualHost *:80>
        DocumentRoot "/var/www/html/blog/public"
        ServerName localhost
        <Directory /var/www/html/blog/public>
                Options FollowSymLinks Multiviews
                MultiviewsMatch Any
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

otherwise , your rewrite won't work. Don't know why ,some says it only happens in laravel 5.

MaverickChan left a reply on Jquery Cannot Display All Traversal Data One By One • 9 months ago

problem solved .

remove the array key first . make the array as simple as possible use setTimeout function

var Errors = ["A", "B", "C".....  ];
$.each(Errors , function(index, value) {
    setTimeout(value,function{
    //do things you want.....
}, index * 1000);
});
Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.