2,830 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
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.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
arthvrian left a reply on Laravel Mail Does Not Send To Mailtrap
Ok, your config is OK (.env and config/mail.php)
are you trying this from Windows or Linux (localhost)? or in a test server (i.e DO)?
localhost many times does not have sendmail (as said @billriess) in windows did not exists you must install other tools (i don't remember the name); in linux you can run the command wrote by @billriess
arthvrian left a reply on Laravel Mail Does Not Send To Mailtrap
is your .env config equal to the config shows in mailtrap?
arthvrian left a reply on Laravel Mail Does Not Send To Mailtrap
question
did you are checking YOUR email account or your MAILTRAP account?
arthvrian left a reply on Mb_detect_encoding() Expects Parameter 1 To Be String, Array Given
the error is saying what the problem is
$ input
is an array, maybe it's the input file?
in mb_detect_encoding
you must specify a string, maybe $ input ['name']
? to convert
arthvrian left a reply on How To Get Record In Between Range Of Quantity?
orWhere
with Parameter Grouping
https://laravel.com/docs/5.7/queries#parameter-grouping
test::where('min', '<=', 16)
->where(function ($query) {
$query->where('max', '>=', 16)
->orWhere('max', null);
})
->get();
arthvrian left a reply on Problem To Create A Print Button In Jquery To Laravel
first of all, the javascript is in a 'external' file (like app.js) o embed in the blade view?
if external this will not work, you cannot 'call' a php function inside a .js file you must insert this in the blade view
arthvrian left a reply on Artisan Command Error
PS = PowerShell (as CMD = command prompt)
why do you need it for?
I think you need put the full path for ps.exe (if you need it on your script task) c:.....\ps.exe
arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting
2?
arthvrian left a reply on Laracasts Website Doesn't Work In Firefox
Working from here, FF last version
did you tried in 'Private Window'? did you tried with add-ons (or ad blocker) disabled?
arthvrian left a reply on Problem To Create A Print Button In Jquery To Laravel
try
var algo= '{{ action([email protected], [ido=>"+id+"]) }}';
arthvrian left a reply on Route Redirect
success:function(response) {
$('#IP').html(response.ip);
...
$('div.data').show();
}
arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting
I don't know, maybe
different versions of php/mysql different column types in table (localhost vs production)
in fact, this is not a solution, you must check the datatype of your user and Post, !== must work
arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting
correct how?
you have a !== means the type is important (1 !== '1' is true) did you try with != and pass (not redirected)?
arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting
make a dump of the data
dump(auth()->user()->id);
dump($post->user_id);
you can try Auth:id() instead of auth()->user()->id
arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database
n the index method of ** AnswerController ** you can put
` dump ($ question);
`
Before showing the view and after obtaining the questions, publish some items of that answer.
have you tried my first answer (replace your part of HTML with mine as appropriate depending on whether it is checkbox or radio)? same results?
arthvrian left a reply on Edit() And Destroy() Functions Not Working On Shared Hosting
1, check if not true
dump(auth()->user()->id);
dump($post->user_id);
dd(auth()->user()->id !== $post->user_id);
if(auth()->user()->id !== $post->user_id) {
or you can
if(auth()->user()->id !== $post->user_id) {
dd('Unauthorized');
}
if you see a true
from the dd()
and your id's is not equals or you see Unauthorized
something is happening with one of your id's
arthvrian left a reply on Send Alert When Failed Login
laravel has login events https://laravel.com/docs/5.7/authentication#events
'Illuminate\Auth\Events\Failed' => [
'App\Listeners\LogFailedLogin',
],
arthvrian left a reply on How To Implement Reset Password For Custom Login
did you implement laravel auth (and customize it)? https://laravel.com/docs/5.7/authentication
or is 100% custom?
I you implemented laravel auth you have this already, if not, you must do what you wrote
arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database
correct
[{
id: 1,
title: 'question1',
question_type: 'radio'
option_name: [{
key: 'q1a1',
value: 'answer1'
},
{
key: 'q1a2',
value: 'answer2'
}]
},
{
id: 2,
title: 'question2',
question_type: 'radio'
option_name: [{
key: 'q2a1',
value: 'answer1'
},
{
key: 'q2a2',
value: 'answer2'
}]
}]
incorrect (key is not unique)
[{
id: 1,
title: 'question1',
question_type: 'radio'
option_name: [{
key: 1,
value: 'answer1'
},
{
key: 2,
value: 'answer2'
}]
},
{
id: 2,
title: 'question2',
question_type: 'radio'
option_name: [{
key: 1,
value: 'answer1'
},
{
key: 2,
value: 'answer2'
}]
}]
if your result view (HTML) have errors, in browser console may see 'duplicate id xxx' (some times) or you can view page source and search for duplicates (i.e id="1")
can you post a few items of a '$question' dump()?
arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database
@cronix I only answer this question :P (other questions will come :D)
I assume that $key is unique per question and HTML and question have a radio OR a checkbox (or a text or a textarea) the provided info is not enough to know if is true
Maybe he / she iterates 1-n in each `` `option_name```, in that case, the HTML provided is incorrect (not a unique ID) or maybe not
arthvrian left a reply on Radio Button/checkbox Passing The Wrong Value To The Database
like this?
<input type="radio" id="{{ $key }}" value="{{ $value }}" />
```
arthvrian left a reply on Invalid Argument Supplied For Foreach(), JS File Didn't Work.
the var in the foreach is empty/not exists/is not an array $question->**option_name**
see the browser console, may be a secondary problem in your JS
arthvrian left a reply on Laravel Pagination Links Reset The GET Query
Appending To Pagination Links
You may append to the query string of pagination links using the appends method. For example, to append sort=votes to each pagination link, you should make the following call to appends:
{{ $users->appends(['sort' => 'votes'])->links() }}
in your case you can use $request->query()
as parameter for appends
arthvrian left a reply on I Got An Error When Upgrading My Laravel 5.4 To 5.6
no, it should work, as long as the mysql version does not change so much
or you can go to localhost/phpmyadmin and export each database, backup htdocs, etc., uninstall current xampp and install the new version, import each database to mysql, restore htdocs, etc
arthvrian left a reply on I Got An Error When Upgrading My Laravel 5.4 To 5.6
arthvrian left a reply on I Got An Error When Upgrading My Laravel 5.4 To 5.6
You are updating to 5.7.9
what SO do you have? on windows you must download the PHP zip/installer on mac or linux depends
arthvrian left a reply on Prevent Shared Logins
yes, it's interactive (from the link)
Then, you may use the logoutOtherDevices method on the Auth facade. This method requires the user to provide their current password, which your application should accept through an input form
after login, you can present a form (with a password input) to invalidate the other sessions
arthvrian left a reply on Multiple Domains W/ Single Laravel Install
did you try dump
instead dd
?
try this (untested)
Route::domain('pro.local')->group(function () {
Route::get('/', function () {
dump('PRO');
});
});
Route::domain('media.local')->group(function () {
Route::get('/', function () {
dump('MEDIA');
});
});
Route::domain('software.local')->group(function () {
Route::get('/', function () {
dump('SOFTWARE');
});
});
arthvrian left a reply on Https Creating An Infinite Loop In 5.2
for nginx found this https://bjornjohansen.no/redirect-to-https-with-nginx
server {
listen 80 default_server;
listen [::]:80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
you can look at http://nginx.org/en/docs/http/configuring_https_servers.html
arthvrian left a reply on Https Creating An Infinite Loop In 5.2
try .htaccess
# Redirect all insecure requests
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/ [L,R=301]
# tell web browsers not to even try HTTP on this domain for the next year
# uncomment this only after you've confirmed your site is working on HTTPS, since it commits you to providing it over HTTPS
Header set Strict-Transport-Security "max-age=31536000" env=HTTPS
arthvrian left a reply on Why Isn't The 'deleted_at' Datetime Field Auto-casted?
I think because not all developers use soft deleted
however it will be a new feature in 5.8
arthvrian left a reply on Sending Mail Through One.com Mail Server With Laravel?
from https://help.one.com/hc/en-us/articles/115005887045-Setup-POP3-and-SMTP-for-Gmail (unrelated but may work)
Please use the following settings for the outgoing email:
SMTP server: send.one.com
Username: your email address
Password: the password you use to log in to Webmail
Port: 587
Secured connection: TLS
arthvrian left a reply on Public And Private Visibility In Storage
if you use the local disk, i think that visibility is not working/used (everything goes to local public folder), if you use s3 or other this will work
arthvrian left a reply on Sending Mail Through One.com Mail Server With Laravel?
you miss this
Port and encryption:
- 587 with STARTTLS (recommended)
- 465 with TLS
- 25 with STARTTLS or none
you must set MAIL_ENCRYPTION (if you use the 587 port) to ssl (or tls if still not working) or use port 25 with MAIL_ENCRYPTION=null
arthvrian left a reply on Getting The Login To Redirect To The Previous Page
yes (redirects to home),
but you can use back()
Sometimes you may wish to redirect the user to their previous location, such as when a submitted form is invalid. You may do so by using the global back helper function. Since this feature utilizes the session, make sure the route calling the back function is using the web middleware group or has all of the session middleware applied:
Route::post('user/profile', function () {
// Validate the request...
return back()->withInput();
});
arthvrian left a reply on Laravel Passport API With Javascript
is the route login listed (after running this command)?
php artisan route:list
arthvrian left a reply on How To Get Id In Hidden Field From Slug In Laravel?
get the id (school_id
) in the controller and pass to the view
// example
public function index($school_id) {
return view('reviews', compact('school_id')):
}
in the view:
arthvrian left a reply on Too Few Arguments To Function App?Http?Controllers?PostController::DateiAusGnu(), 0 Passed And Exactly 1 Expected
is $post
defined in the controller?
is $post
not null?
is $post
passed to the view?
arthvrian left a reply on Capturing Checkboxes With An Array.
replace
'''''' Yes
With
Yes ''''''
i think you must add a javascript event (un-check) to set value="0"
or you can run a loop over the answers in your store method and check if the answer array have these id (value="on")
arthvrian left a reply on Laravel 42000 Syntax Error Or Access Voilation 1064 You Have An Error In Sql Syntax
as it says, it's an sql error 'data-> type' is the name of the column in your table? or just 'type'? (I guess its 'type')
arthvrian left a reply on PHP Query
short answer: in PHP you MUST define a variable BEFORE use it long answer: before run a SQL query, you MUST validate, sanitise and secure your input (local or user input), another link to read :P https://www.dreamhost.com/blog/php-security-user-validation-sanitization/
arthvrian left a reply on Changing The Heading In Forgot Password
php artisan vendor:publish
and select laravel-mail tag (I'm not sure)resources/views/vendor/mail/html/header.blade.php
Note: All mails share the same structure
arthvrian left a reply on How To Hit The Api Route
try php artisan route:list
, check for api routes
arthvrian left a reply on Laravel Where('user_id') Seems Completely Ignored
OR WHERE invalidate the previous WHERE, query result:
SELECT * FROM Pigeon WHERE user_id =? AND name LIKE '%?%' OR ringnumber LIKE '%?%'
You can do someting like:
User::pigeons()->where('name', 'LIKE', '%'.$q.'%')->orWhere('ringnumber','LIKE','%'.$q.'%')
arthvrian left a reply on Why Did Not Save Multiple Images With Controller Route Return?
nope
for (....)
$upload->save();
}
return redirect()->route('categories.categorypost')->with('info','Your Advertisment has been created successfully');
arthvrian left a reply on Why Did Not Save Multiple Images With Controller Route Return?
You must close the for
BEFORE the return (i don't see the })
arthvrian left a reply on Google Gmail SMTP
Is this domain hjorturfreyr.com using GSuite?
Yo cann't send a email throught gmail without a google accout (Gmail/GSuite)
[email protected] // must be a Google Account
arthvrian left a reply on Why Is Php Artisan Serve Not Working Anymore?
Maybe you 'kill' MySQL too
it seems that your MySQL server is down or running on another port
arthvrian left a reply on If A Reply Is Too Long, You Can't Edit It
arthvrian left a reply on All Problems With The New Laracasts Design
@JEFFREYWAY - thanks, maked as fixed :D