Search
 
SCRIPT & CODE EXAMPLE
 

PHP

signup API in laravel

/**
 * API Register
 *
 * @param Request $request
 * @return IlluminateHttpJsonResponse
 */
public function register(Request $request)
{
    $rules = [
        'name' => 'unique:users|required',
        'email'    => 'unique:users|required',
        'password' => 'required',
    ];

    $input     = $request->only('name', 'email','password');
    $validator = Validator::make($input, $rules);

    if ($validator->fails()) {
        return response()->json(['success' => false, 'error' => $validator->messages()]);
    }
    $name = $request->name;
    $email    = $request->email;
    $password = $request->password;
    $user     = User::create(['name' => $name, 'email' => $email, 'password' => Hash::make($password)]);

}
Comment

PREVIOUS NEXT
Code Example
Php :: display woocommerce review using specific id 
Php :: FT_USER 
Php :: WordPress Plugin Code Definition 
Php :: default time zone for europe php 
Php :: wordrpess debugg is off but still showing 
Php :: Validating data received via the Web App php 
Php :: only fetch specific array keys php 
Php :: docker commant 
Php :: apagar windows desde consola 
Php :: mod_fcgid: stderr: PHP Fatal error: Maximum execution time of 0 seconds exceeded in /home/circusconcepts/public_html/shop/system/library/PHPExcel/Shared/String.php on line 576 
Php :: Route::any 
Php :: Comment ajouter un fil d’Ariane personnalisé à l’URL d’accueil dans WooCommerce 
Php :: easyadminbundle 4 $this-get(EntityRepository::class) error 
Php :: Grab files matching particular file types in a directory 
Php :: file viewer codeigniter 
Php :: webmin apache php not working 
Php :: customize+forgot+password+laravel 
Php :: Fibers - PHP 8.1 
Php :: php questions in tasks 
Php :: BelongsToMany relations pivot fields are null in Livewire refresh 
Php :: Binance api buymarket php 
Php :: php tableaux 
Php :: loop IlluminateSupportCollection Object ( [items:protected] = 
Php :: php -phone number verification 
Php :: How to perform form inpot in laravel 8 and export database 
Php :: How to append json array using jq+shell in a loop 
Php :: wp plugin handles deregister 
Php :: Ciclo for PHP ejemplos 
Php :: letzten 3 zeichen aus einem string entfernen php 
Php :: in connection.php line 664: could not find driver (sql: select * from information_schema.tables where table_schema = news and table_name = migrations) in connector.php line 67: could not find driver 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =