Jump to content

eXPlosion

New Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by eXPlosion

  1. It's from this tutorial step-by-step stuck at 1:16:35
  2. I have bitnami LAMPStack 7.4.6-1 running MySQL database on 3306 port on newest Ubuntu. Symfony version 5.1.0 When I run this command as root user: root@ubuntu:/opt/lampstack-7.4.6-1/apache2/htdocs/sfcourse# php bin/console doctrine:database:create The error is: An exception occurred in driver: SQLSTATE[HY000] [1045] Access denied for user 'db_user'@'127.0.0.1' (using password: YES) I don't know where db_user is comming from, .env file is defining other user. .env file DATABASE_URL=mysql://root:000000@localhost:3306/sfcourse doctrine.yaml file: doctrine: # parameters: # env(DATABASE_URL): '' dbal: driver: 'pdo_mysql' server_version: '5.7' charset: utf8mb4 default_table_options: charset: utf8mb4 collate: utf8mb4_unicode_ci url: '%env(resolve:DATABASE_URL)%' googled but most suggestions are to make 127.0.0.1 as localhost MySQL version is 8.0.20 after checking mysql> SHOW VARIABLES LIKE "%version%"; I can login to SQL via terminal as root, that is working I created that strange user db_user in MySQL and in .env file and got still same error. I can connect as db_user to MySQL. If I change user in .env to other, error still says db_user. EDIT: this is same question https://stackoverflow.com/questions/55687722/an-exception-occurred-in-driver-sqlstatehy000-1045-access-denied-for-user, he installed what he had and that solved problem? Dumb
  3. I'm wondering would it work if i change $message->to($emails); to $message->bcc($emails);
  4. No, receivers should not see other receivers in email (email contains many receivers). Like bcc (blind copy) in outlook
  5. here is mail controller class <?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; use App\MassMail; use App\Contact; use Illuminate\Support\Facades\Auth; use Mail; class MassMailController extends Controller { public function index() { $mails = MassMail::orderBy('date_sent', 'DESC')->get(); return view('mail.mass.index')->with('mails', $mails); } public function show($id) { $mail = MassMail::findOrFail($id); return view('mail.mass.show')->with('mail', $mail); } public function create() { $movies = Auth::user()->movies()->lists('title', 'id'); return view('mail.mass.create')->with('movies', $movies); } public function send(Requests\EmailTemplateRequest $request) { $emails = Contact::whereNotNull('email')->lists('email')->toArray(); Mail::send(['text' => 'emails.plain'], ['text' => $request->message], function ($message) use ($request, $emails) { $message->from('info@someone.com', $request->sender); $message->subject($request->subject); $message->to($emails); }); //send $mail = new MassMail($request->all()); $mail->date_sent = \Carbon\Carbon::now(); $mail->recipent_count = count($emails); \Auth::user()->massMail()->save($mail); $contacts = Contact::whereNotNull('email')->lists('id')->toArray(); foreach($contacts as $contact){ $mail->recipents()->attach($contact); } return redirect('mail/mass'); } } There is a requirement that multiple receivers won't see other receivers. Like blind copy. How to modify it? Thanks. There is also mass mail class, which looks like this: <?php namespace App; use Illuminate\Database\Eloquent\Model; class MassMail extends Model { /** * The table associated with the model. * * @var string */ protected $table = 'mass_mails'; protected $fillable = [ 'sender', 'subject', 'message', 'movie_id' ]; public $timestamps = false; public function recipents() { return $this->belongsToMany('App\Contact', 'contact_mass_mail_pivot', 'mass_mail_id', 'contact_id'); } } Any ideas?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.