@return mixed
*/
public function upload()
{
if (Input::hasFile('file')) {
$currentUser = \Auth::user();
$avatar = Input::file('file');
$filename = 'avatar.'.$avatar->getClientOriginalExtension();
$save_path = storage_path().'/users/id/'.$currentUser->id.'/uploads/images/avatar/';
$path = $save_path.$filename;
$public_path = '/images/profile/'.$currentUser->id.'/avatar/'.$filename;
// Make the user a folder and set permissions
File::makeDirectory($save_path, $mode = 0755, true, true);
// Save the file to the server
Image::make($avatar)->resize(300, 300)->save($save_path.$filename);
// Save the public image path
$currentUser->profile->avatar = $public_path;
$currentUser->profile->save();
return response()->json(['path'=> $path], 200);
} else {
return response()->json(false, 200);
}
}
/**
Show user avatar.
@param $id
@param $image
@return string
*/
public function userProfileAvatar($id, $image)
{
return Image::make(storage_path().'/users/id/'.$id.'/uploads/images/avatar/'.$image)->response();
}`
web.php (route)
`// Registered, activated, and is current user routes.
Route::group(['middleware'=> ['auth', 'activated', 'currentUser']], function () {
// User Profile and Account Routes
Route::resource(
'profile',
'ProfilesController', [
'only' => [
'show',
'edit',
'update',
'create',
],
]
);
Route::put('profile/{username}/updateUserAccount', [
'as' => '{username}',
'uses' => 'ProfilesController@updateUserAccount',
]);
Route::put('profile/{username}/updateUserPassword', [
'as' => '{username}',
'uses' => 'ProfilesController@updateUserPassword',
]);
Route::delete('profile/{username}/deleteUserAccount', [
'as' => '{username}',
'uses' => 'ProfilesController@deleteUserAccount',
]);
// Route to show user avatar
Route::get('images/profile/{id}/avatar/{image}', [
'uses' => 'ProfilesController@userProfileAvatar',
]);
// Route to upload user avatar.
Route::post('avatar/upload', ['as' => 'avatar.upload', 'uses' => 'ProfilesController@upload']);
});`
File is present at:
ls -alth
total 24K
-rwxr-xr-x 1 www www 16K Oct 6 18:14 avatar.jpg
drwxr-xr-x 2 www www 512 Oct 2 13:37 .
drwxr-xr-x 3 www www 512 Oct 2 13:37 ..
<root@test-server :/usr/local/www/test-site.com/test.v210/storage/users/id/1/uploads/images/avatar> #
do i need to symlink or create the image folder in public ?
how to add a new role lets say "half admin" , that will have permissions more then the user but less then admin ? what would i need to add to get there ? thanks
I've successfully run this app.
Now I just want to know ->
user A can't view user B information.
but admin can view all information and edit access.
Hi,
I'm newbie laravel and interesting laravel for user manage.
I can't access Login and Register menu when i click are show 404 Not Found
Then i check route on routes/wep.php but haven't /register or /login.
Please help.
Thank you.
Hello, I want to customize login page, I want to use custom attribute instead of email.
I changed something like this in views/auth/login:
<div class="form-group has-feedback">
{!! Form::label('ktp', Lang::get('auth.ktp') , array('class' => 'col-sm-4 control-label')); !!}
<div class="col-sm-6">
{!! Form::text('ktp', null, array('id' => 'ktp', 'class' => 'form-control', 'placeholder' => Lang::get('auth.ph_ktp'), 'required' => 'required',)) !!}
<span class="glyphicon glyphicon-envelope form-control-feedback" aria-hidden="true"></span>
</div>
</div>
And I always got:
Whoops! There were some problems with your input.
The email field is required.
Password Troubles?
How to customize it?
Hello,
Just tried a new installation and I got this error:
ErrorException in SendActivationEmail.php line 50:
Trying to get property of non-object
in SendActivationEmail.php line 50
at HandleExceptions->handleError(8, 'Trying to get property of non-object', '/var/www/servicebucket/app/Notifications/SendActivationEmail.php', 50, array('notifiable' => object(User), 'message' => object(MailMessage))) in SendActivationEmail.php line 50
Its related to namespacing ..
Shouldnt it work out of the box or I have to adjust something ?
What you think
Thanks
Sergiu
![screen shot 2017-04-21 at 14 34 55](https://cloud.githubusercontent.com/assets/2030016/25279886/dfc6e10a-269f-11e7-8f05-9873ce36d46e.png)
getting Error on localhost/themes
Whoops, looks like something went wrong. 2/2 ErrorException in 0d7da4803c3fadc8dc0a815b1ea3db0e7dbc9c47.php line 75: Trying to get property of non-object (View: /laravel-auth/resources/views/themesmanagement/show-themes.blade.php)
I installed laravel-auth, migrated and seeded (using laravel 5.4.27 and mysql Ver 14.14 Distrib 5.6.21, for Win32 (x86))
when i tried to login, at first login looped back
then i created google+ sign in application and got credentials, changed my session_domain to http://localhost
next i tried to register via google+ but there arrived token mismatch error
after that token mismatch error occurred on registration as well as login
I tried deleting cookies, cleared cache but couldn't make it work
`
{!! Form::open(['route' => 'register', 'class' => 'form-horizontal', 'role' => 'form', 'method' => 'POST'] ) !!}
{{ csrf_field() }}
<div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">`
I var_dumped in middlewares and pipeline files but couldn't make it work....
Thank you in advance!!
localhost_8000_register.pdf
when l register with FB give me this error when i logged from any where which i dont logged in facebook before ?
it should give me a sign in form of facebook to continue
great project we have some issue.
/var/www/mydomain.com/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php
"Method [throwValidationException] does not exist."
Hi , I am getting flowing error while sending emails (i.e) wherever the emails is triggered in application
Error :
Swift_TransportException in AbstractSmtpTransport.php line 383:
Expected response code 220 but got code "", with message ""
in AbstractSmtpTransport.php line 383
at Swift_Transport_AbstractSmtpTransport->_assertResponseCode('', array('220')) in AbstractSmtpTransport.php line 289
at Swift_Transport_AbstractSmtpTransport->_readGreeting() in AbstractSmtpTransport.php line 117
at Swift_Transport_AbstractSmtpTransport->start() in Mailer.php line 79
The phpinfo()
command generates a complete page - all elements needed, including html
and body
elements. The output of phpinfo()
seems to have been just plonked into the middle of the page without regard for this. It needs to have its body content stripped out, and just that content put into the page. Or maybe open in a new window on its own, or perhaps in an auto-resizing iframe.
The social network login icons are all displayed through views, and can be easily removed by editing those views.
However, just removing the account details from .env
ought to remove the facility for logging in using those networks too. A github ID of "YOURIDHERE" is fine for demonstration out of the box, and takes the user to a 404 page with that ID, as you would expect. But if I set the Github ID to "", then it makes sense for Gibhub authentication to simply be disabled - no icons, no links, no Guthub registration.
Does that sound a sensible approach?
i am getting this error when i press on activate account in the email sended to me , !
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (admin_multiauth
.profiles
, CONSTRAINT profiles_theme_id_foreign
FOREIGN KEY (theme_id
) REFERENCES themes
(id
)) (SQL: insert into profiles
(user_id
, updated_at
, created_at
) values (2, 2017-10-07 15:26:00, 2017-10-07 15:26:00))
Hi, i'm thank about your source. But i try to test it, i create controller with name TestController and have content in below. I add route but user [email protected] can view but it doesn't have permission
Route::group(['middleware' => ['auth', 'activated']], function () { Route::get('/test', [ 'as' => 'test.index', 'uses' => 'TestController@index', ]); }
`<?php
namespace App\Http\Controllers;
use Auth;
class TestController extends Controller
{
/**
Hi Jeremy,
Can I use this with Laravel 5.3/5.4? I already seen your another laraver-user but there's no role and permission management.
Thank you!
I did a fresh install. login as Admin and select profile I get error 404. The user works fine.
I created a new admin user and can see his profile.
Is there a setting missing when the admin user is created.
Thanks.
hey your code is very clean and good. some how i am newbie and i can't get the logic to get diferents providers to social_id and avatar rows in social_login. can you give the logic? just the concept
i has very near but the code was continued add new rows dont know how to check
[(http://pastebin.com/rPYtdgLd)]
thanks!
Currently, if i try and log in or register via Facebook (only one i've tested so far) and decide not to share my email address with the site, Gravatar squawks at me instantly and I cannot view anything because the email address is an incorrect format for Gravatar.
"Please specify a valid email address (View: /Users/noreason/code/laravel-auth/resources/views/profiles/show.blade.php)"
in
/Users/noreason/code/laravel-auth/vendor/creativeorange/gravatar/src/Gravatar.php
The email address generated for this specific login was
I can solve the issue with workarounds, but I was just wondering if I am missing something somewhere?
[Illuminate\Database\QueryException]
could not find driver (SQL: select * from information_schema.tables where table_sc
hema = laravelAuth and table_name = migrations)
[Doctrine\DBAL\Driver\PDOException]
could not find driver
[PDOException]
could not find driver
Do you have any way to install this awesome package on a different laravel installation without using the laravel you used?
Recommend Projects
-
-
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
An Open Source Machine Learning Framework for Everyone
-
The Web framework for perfectionists with deadlines.
-
A PHP framework for web artisans
-
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
Some thing interesting about web. New door for the world.
-
A server is a program made to process requests and deliver data to clients.
-
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Some thing interesting about visualization, use data art
-
Some thing interesting about game, make everyone happy.
-
Recommend Org
-
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Open source projects and samples from Microsoft.
-
Google โค๏ธ Open Source for everyone.
-
Alibaba Open Source for everyone
-
Data-Driven Documents codes.
-
China tencent open source team.
-